elf32_getchdr, elf64_getchdr - retrieve class-dependent compression header
cc [ flag ... ] file ... –lelf [ library ... ] #include <libelf.h> Elf32_Chdr *elf32_getchdr(Elf_Scn *scn);
Elf64_Chdr *elf64_getchdr(Elf_Scn *scn);
For a compressed section in a 32-bit class file, elf32_getchdr() returns a pointer to a compression header for the section descriptor scn. Otherwise, the file is not a 32-bit class file, the section is not compressed, scn was NULL, or an error occurred; elf32_getchdr() then returns NULL.
The elf32_getchdr header includes the following members:
Elf32_Word ch_type; Elf32_Word ch_size; Elf32_Word ch_addralign;
while the elf64_getchdr header includes the following members:
Elf64_Word ch_type; Elf64_Xword ch_size; Elf64_Xword ch_addralign;
For the 64-bit class, replace 32 with 64 as appropriate.
elf32_chdr() and elf64_chdr() understand the standard ELF compression format, indicated by the presence of the SHF_COMPRESSED section header flag. These routines are unable to process sections formatted in the original GNU compression format. The original GNU compression format is deprecated. See elf_compress_gnu(3ELF).
See attributes(7) for descriptions of the following attributes:
|
elf(3ELF), elf_compress(3ELF), elf_compress_gnu(3ELF), libelf(3LIB), attributes(7)