1elf_getarhdr(3ELF)           ELF Library Functions          elf_getarhdr(3ELF)
2
3
4

NAME

6       elf_getarhdr - retrieve archive member header
7

SYNOPSIS

9       cc [ flag ... ] file ... -lelf [ library... ]
10       #include <libelf.h>
11
12       Elf_Arhdr *elf_getarhdr(Elf *elf);
13
14

DESCRIPTION

16       elf_getarhdr() returns a pointer to an archive member header, if one is
17       available for the ELF descriptor  elf.  Otherwise,  no  archive  member
18       header  exists, an error occurred, or elf was null; elf_getarhdr() then
19       returns a null value. The header includes the following members.
20
21         char *ar_name;
22         time_t    ar_date;
23         uid_t     ar_uid;
24         gid_t     ar_gid;
25         mode_t    ar_mode;
26         off_t     ar_size;
27         char *ar_rawname;
28
29
30
31       An archive member name, available through ar_name, is a null-terminated
32       string,  with  the ar format control characters removed. The ar_rawname
33       member holds a null-terminated string that represents the original name
34       bytes  in the file, including the terminating slash and trailing blanks
35       as specified in the archive format.
36
37
38       In addition to ``regular'' archive members, the archive format  defines
39       some  special members. All special member names begin with a slash (/),
40       distinguishing them from regular members (whose names may not contain a
41       slash). These special members have the names (ar_name) defined below.
42
43       /     This  is  the  archive  symbol  table. If present, it will be the
44             first archive member. A program may access the archive symbol ta‐
45             ble  through  elf_getarsym(). The information in the symbol table
46             is useful  for  random  archive  processing  (see  elf_rand()  on
47             elf_begin(3ELF)).
48
49
50       //    This  member,  if  present, holds a string table for long archive
51             member names. An archive member's header contains a 16-byte  area
52             for  the  name,  which  may be exceeded in some file systems. The
53             library automatically retrieves long member names from the string
54             table, setting ar_name to the appropriate value.
55
56
57
58       Under  some  error  conditions, a member's name might not be available.
59       Although this causes the library to set ar_name to a null pointer,  the
60       ar_rawname member will be set as usual.
61

ATTRIBUTES

63       See attributes(5) for descriptions of the following attributes:
64
65
66
67
68       ┌─────────────────────────────┬─────────────────────────────┐
69       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
70       ├─────────────────────────────┼─────────────────────────────┤
71       │Interface Stability          │Stable                       │
72       ├─────────────────────────────┼─────────────────────────────┤
73       │MT-Level                     │MT-Safe                      │
74       └─────────────────────────────┴─────────────────────────────┘
75

SEE ALSO

77       ar.h(3HEAD),     elf(3ELF),     elf_begin(3ELF),    elf_getarsym(3ELF),
78       libelf(3LIB), attributes(5)
79
80
81
82SunOS 5.11                        11 Jul 2001               elf_getarhdr(3ELF)
Impressum