The libelf library simplifies the task of creating portable and architecture-independent tools that read and write ELF files.
This implementation of libelf implements the full SVR4 ELF(3)/GELF(3) API set, along with a few minor extensions.
API | Implementation | Manual Page | Test Cases | Comments |
---|---|---|---|---|
Error Handling | ||||
elf_errno() |
Y | Y | Y | |
elf_errmsg() |
Y | Y | Y | |
Initialization | ||||
elf_begin() |
Y | Y | Y | |
elf_end() |
Y | Y | Partial | |
elf_memory() |
Y | Y | Y | |
Archive Access | ||||
elf_rand() |
Y | Y | Partial | |
elf_next() |
Y | Y | Y | |
elf_getarsym() |
Y | Y | Y | |
elf_getarhdr() |
Y | Y | Y | |
ELF Class/Byte order Translation | ||||
elf32_xlatetof() |
Y | Y | Y | |
elf32_xlatetom() |
Y | Y | Y | |
elf64_xlatetof() |
Y | Y | Y | |
elf64_xlatetom() |
Y | Y | Y | |
gelf_xlatetof() |
Y | Y | Y | |
gelf_xlatetom() |
Y | Y | Y | |
General Queries | ||||
elf_getbase() |
Y | Y | Y | |
elf_getident() |
Y | Y | Y | |
elf_getphdrnum() |
Y | Y | ||
elf_getphnum() |
Y | Y | Deprecated API. See [LibElfIncompatibilityRedHatElfUtils]. | |
elf_getshdrnum() |
Y | Y | ||
elf_getshnum() |
Y | Y | Y | Deprecated API. See [LibElfIncompatibilityRedHatElfUtils]. |
elf_getshdrstrndx() |
Y | Y | ||
elf_getshstrndx() |
Y | Y | Y | Deprecated API. See [LibElfIncompatibilityRedHatElfUtils]. |
elf_hash() |
Y | Y | Y | |
elf_kind() |
Y | Y | Y | |
elf_ndxscn() |
Y | Y | Y | |
elf_rawdata() |
Y | Y | ||
elf_rawfile() |
Y | Y | Y | |
elf_version() |
Y | Y | Y | |
elf32_checksum() |
Y | Y | ||
elf32_fsize() |
Y | Y | Y | |
elf64_checksum() |
Y | Y | ||
elf64_fsize() |
Y | Y | Y | |
gelf_checksum() |
Y | Y | ||
gelf_getclass() |
Y | Y | Y | |
gelf_fsize() |
Y | Y | Y | |
Elf Headers | ||||
elf32_getehdr() |
Y | Y | Y | |
elf32_getphdr() |
Y | Y | Y | |
elf32_getshdr() |
Y | Y | Y | |
elf32_newehdr() |
Y | Y | Y | |
elf32_newphdr() |
Y | Y | ||
elf64_getehdr() |
Y | Y | Y | |
elf64_getphdr() |
Y | Y | Y | |
elf64_newehdr() |
Y | Y | Y | |
elf64_newphdr() |
Y | Y | ||
elf64_getshdr() |
Y | Y | Y | |
gelf_getehdr() |
Y | Y | Y | |
gelf_getphdr() |
Y | Y | ||
gelf_getshdr() |
Y | Y | ||
gelf_newehdr() |
Y | Y | Y | |
gelf_newphdr() |
Y | Y | ||
gelf_update_ehdr() |
Y | Y | ||
gelf_update_phdr() |
Y | Y | ||
gelf_update_shdr() |
Y | Y | ||
Elf Sections | ||||
elf_getscn() |
Y | Y | Y | |
elf_nextscn() |
Y | Y | Y | |
elf_newscn() |
Y | Y | Y | |
Elf Data | ||||
elf_fill() |
Y | Y | ||
elf_getdata() |
Y | Y | ||
elf_newdata() |
Y | Y | ||
elf_strptr() |
Y | Y | ||
gelf_getdyn() |
Y | Y | ||
gelf_getmove() |
Y | Y | ||
gelf_getrel() |
Y | Y | ||
gelf_getrela() |
Y | Y | ||
gelf_getsym() |
Y | Y | ||
gelf_getsyminfo() |
Y | Y | ||
gelf_getsymshndx() |
Y | Y | ||
gelf_update_dyn() |
Y | Y | ||
gelf_update_move() |
Y | Y | ||
gelf_update_rel() |
Y | Y | ||
gelf_update_rela() |
Y | Y | ||
gelf_update_sym() |
Y | Y | ||
gelf_update_syminfo() |
Y | Y | ||
gelf_update_symshndx() |
Y | Y | ||
I/O Control | ||||
elf_cntl() |
Y | Y | Y | |
elf_flagdata() |
Y | Y | Y | |
elf_flagehdr() |
Y | Y | Y | |
elf_flagphdr() |
Y | Y | Y | |
elf_flagscn() |
Y | Y | Y | |
elf_flagshdr() |
Y | Y | Y | |
elf_update() |
Y | Y | Y | |
API Extensions | ||||
elf_add_member() |
See [LibElfArchiveCreation] | |||
elf_add_symtab() |
See [LibElfArchiveCreation] | |||
elf_flagarhdr() |
Y | Y | See [LibElfArchiveCreation] | |
elf_open() |
Y | |||
elf_openmember() |
Y | |||
elf_setshstrndx() |
Y | Y |
Known incompatibilities with other ELF(3) implementations.
Wiki: BuildingFromSource
Wiki: LibElfArchiveCreation
Wiki: LibElfIncompatibilityRedHatElfUtils
Wiki: LibElfTestSuite