1elf32_getshdr(3ELF) ELF Library Functions elf32_getshdr(3ELF)
2
3
4
6 elf32_getshdr, elf64_getshdr - retrieve class-dependent section header
7
9 cc [ flag ... ] file ... -lelf [ library ... ]
10 #include <libelf.h>
11
12 Elf32_Shdr *elf32_getshdr(Elf_Scn *scn);
13
14
15 Elf64_Shdr *elf64_getshdr(Elf_Scn *scn);
16
17
19 For a 32-bit class file, elf32_getshdr() returns a pointer to a section
20 header for the section descriptor scn. Otherwise, the file is not a
21 32-bit class file, scn was NULL, or an error occurred; elf32_getshdr()
22 then returns NULL.
23
24
25 The elf32_getshdr header includes the following members:
26
27 Elf32_Word sh_name;
28 Elf32_Word sh_type;
29 Elf32_Word sh_flags;
30 Elf32_Addr sh_addr;
31 Elf32_Off sh_offset;
32 Elf32_Word sh_size;
33 Elf32_Word sh_link;
34 Elf32_Word sh_info;
35 Elf32_Word sh_addralign;
36 Elf32_Word sh_entsize;
37
38
39
40 while the elf64_getshdr header includes the following members:
41
42 Elf64_Word sh_name;
43 Elf64_Word sh_type;
44 Elf64_Xword sh_flags;
45 Elf64_Addr sh_addr;
46 Elf64_Off sh_offset;
47 Elf64_Xword sh_size;
48 Elf64_Word sh_link;
49 Elf64_Word sh_info;
50 Elf64_Xword sh_addralign;
51 Elf64_Xword sh_entsize;
52
53
54
55 For the 64−bit class, replace 32 with 64 as appropriate.
56
57
58 If the program is building a new file, it is responsible for creating
59 the file's ELF header before creating sections.
60
62 See attributes(5) for descriptions of the following attributes:
63
64
65
66
67 ┌─────────────────────────────┬─────────────────────────────┐
68 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
69 ├─────────────────────────────┼─────────────────────────────┤
70 │Interface Stability │Stable │
71 ├─────────────────────────────┼─────────────────────────────┤
72 │MT-Level │MT-Safe │
73 └─────────────────────────────┴─────────────────────────────┘
74
76 elf(3ELF), elf_flagdata(3ELF), elf_getscn(3ELF), elf_strptr(3ELF),
77 libelf(3LIB), attributes(5)
78
79
80
81SunOS 5.11 11 Jul 2001 elf32_getshdr(3ELF)