elf_getarhdr(3)

elf_getarhdr3

Retrieve archive member header information

Usage

#include <libelf.h>
Elf_Arhdr *elf_getarhdr(Elf *elf);

Overview

Return a Elf_Arhdr * describing the archive header of the archive member currently referred to by an ELF descriptor.

The Elf_Arhdr structure is defined as:

typedef struct {
  char *ar_name;                /* Name of archive member.  */
  time_t ar_date;               /* File date.  */
  uid_t ar_uid;                 /* User ID.  */
  gid_t ar_gid;                 /* Group ID.  */
  mode_t ar_mode;               /* File mode.  */
  int64_t ar_size;              /* File size.  */
  char *ar_rawname;             /* Original name of archive member.  */
} Elf_Arhdr;

Parameters

elf

An ELF descriptor referring to a member of an archive file.

Return value

If elf refers to an archive member, elf_getarhdr() returns a pointer to its archive header. This pointer is valid until elf or the parent archive Elf descriptor are closed using elf_end(). If elf does not refer to an archive member or the header cannot be acquired then NULL is returned.

Attributes

InterfaceAttributeValue
elf_getarhdr()Thread safetyMT-safe

Reporting bugs

Report bugs to <[email protected]> or https://sourceware.org/bugzilla/.

From libelf 0.197-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.