libabigail
|
This contains the definitions of the ELF utilities for the dwarf reader. More...
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
#include <elfutils/libdwfl.h>
#include <sstream>
#include "abg-elf-helpers.h"
#include "abg-tools-utils.h"
Go to the source code of this file.
Namespaces | |
abigail | |
Toplevel namespace for libabigail. | |
Functions | |
bool | address_is_in_opd_section (Elf *elf_handle, Dwarf_Addr addr) |
Return true if an address is in the ".opd" section that is present on the ppc64 platform. More... | |
bool | address_is_in_section (Dwarf_Addr addr, Elf_Scn *section) |
Test if a given address is in a given section. More... | |
bool | architecture_is_arm32 (Elf *elf_handle) |
Test if the architecture of the current binary is arm32. More... | |
bool | architecture_is_arm64 (Elf *elf_handle) |
Test if the architecture of the current binary is arm64. More... | |
bool | architecture_is_big_endian (Elf *elf_handle) |
Test if the endianness of the current binary is Big Endian. More... | |
bool | architecture_is_ppc32 (Elf *elf_handle) |
Test if the architecture of the current binary is ppc32. More... | |
bool | architecture_is_ppc64 (Elf *elf_handle) |
Test if the architecture of the current binary is ppc64. More... | |
dwfl_sptr | create_new_dwfl_handle (Dwfl_Callbacks &cb) |
std::string | e_machine_to_string (GElf_Half e_machine) |
Convert the value of the e_machine field of GElf_Ehdr into a string. This is to get a string representing the architecture of the elf file at hand. More... | |
Elf_Scn * | find_bss_section (Elf *elf_handle) |
Find and return the .bss section. More... | |
Elf_Scn * | find_data1_section (Elf *elf_handle) |
Find and return the .data1 section. More... | |
Elf_Scn * | find_data_section (Elf *elf_handle) |
Find and return the .data section. More... | |
Elf_Scn * | find_dynsym_section (Elf *elf_handle) |
Find and return the .symtab section. More... | |
hash_table_kind | find_hash_table_section_index (Elf *elf_handle, size_t &ht_section_index, size_t &symtab_section_index) |
Get the offset offset of the hash table section. More... | |
Elf_Scn * | find_ksymtab_gpl_section (Elf *elf_handle) |
Return the __ksymtab_gpl section of a linux kernel ELF file (either a vmlinux binary or a kernel module). More... | |
Elf_Scn * | find_ksymtab_section (Elf *elf_handle) |
Return the __ksymtab section of a linux kernel ELF file (either a vmlinux binary or a kernel module). More... | |
Elf_Scn * | find_ksymtab_strings_section (Elf *elf_handle) |
Find the __ksymtab_strings section of a Linux kernel binary. More... | |
Elf_Scn * | find_opd_section (Elf *elf_handle) |
Return the "Official Procedure descriptors section." This section is named .opd, and is usually present only on PPC64 ELFv1 binaries. More... | |
Elf_Scn * | find_relocation_section (Elf *elf_handle, Elf_Scn *target_section) |
Return the .rel{a,} section corresponding to a given section. More... | |
Elf_Scn * | find_rodata_section (Elf *elf_handle) |
Find and return the .rodata section. More... | |
Elf_Scn * | find_section (Elf *elf_handle, const std::string &name, Elf64_Word section_type) |
Find and return a section by its name and its type. More... | |
Elf_Scn * | find_section (Elf *elf_handle, Elf64_Word section_type) |
Find and return a section by its type. More... | |
Elf_Scn * | find_section_by_name (Elf *elf_handle, const std::string &name) |
Find and return a section by its name. More... | |
Elf_Scn * | find_strtab_for_symtab_section (Elf *elf_handle, Elf_Scn *symtab_section) |
Return the string table used by the given symbol table. More... | |
Elf_Scn * | find_symbol_table_section (Elf *elf_handle) |
Find the symbol table. More... | |
bool | find_symbol_table_section_index (Elf *elf_handle, size_t &symtab_index) |
Find the index (in the section headers table) of the symbol table section. More... | |
Elf_Scn * | find_symtab_section (Elf *elf_handle) |
Find and return the .symtab section. More... | |
Elf_Scn * | find_text_section (Elf *elf_handle) |
Find and return the .text section. More... | |
unsigned char | get_architecture_word_size (Elf *elf_handle) |
Return the size of a word for the current architecture. More... | |
bool | get_binary_load_address (Elf *elf_handle, GElf_Addr &load_address) |
Get the address at which a given binary is loaded in memory. More... | |
bool | get_crc_for_symbol (Elf *elf_handle, GElf_Sym *crc_symbol, uint32_t &crc_value) |
Return the CRC from the "__crc_" symbol. More... | |
bool | get_soname_of_elf_file (const string &path, string &soname) |
Fetch the SONAME ELF property from an ELF binary file. More... | |
bool | get_symbol_versionning_sections (Elf *elf_handle, Elf_Scn *&versym_section, Elf_Scn *&verdef_section, Elf_Scn *&verneed_section) |
Return the SHT_GNU_versym, SHT_GNU_verdef and SHT_GNU_verneed sections that are involved in symbol versionning. More... | |
bool | get_version_definition_for_versym (Elf *elf_handle, GElf_Versym *versym, Elf_Scn *verdef_section, elf_symbol::version &version) |
Get the version definition (from the SHT_GNU_verdef section) of a given symbol represented by a pointer to GElf_Versym. More... | |
bool | get_version_for_symbol (Elf *elf_handle, size_t symbol_index, bool get_def_version, elf_symbol::version &version) |
Return the version for a symbol that is at a given index in its SHT_SYMTAB section. More... | |
bool | get_version_needed_for_versym (Elf *elf_handle, GElf_Versym *versym, Elf_Scn *verneed_section, elf_symbol::version &version) |
Get the version needed (from the SHT_GNU_verneed section) to resolve an undefined symbol represented by a pointer to GElf_Versym. More... | |
const Dwfl_Callbacks & | initialize_dwfl_callbacks (Dwfl_Callbacks &cb, char **debug_info_root_path) |
bool | is_dso (Elf *elf_handle) |
Test if the elf file being read is a dynamic shared / object. More... | |
bool | is_executable (Elf *elf_handle) |
Test if the elf file being read is an executable. More... | |
bool | is_linux_kernel (Elf *elf_handle) |
Test if the ELF binary denoted by a given ELF handle is a Linux Kernel binary (either vmlinux or a kernel module). More... | |
bool | is_linux_kernel_module (Elf *elf_handle) |
Test if the ELF binary denoted by a given ELF handle is a Linux Kernel Module. More... | |
bool | lookup_data_tag_from_dynamic_segment (Elf *elf, Elf64_Sxword data_tag, vector< string > &dt_tag_data) |
Get data tag information of an ELF file by looking up into its dynamic segment. More... | |
GElf_Addr | lookup_ppc64_elf_fn_entry_point_address (Elf *elf_handle, GElf_Addr fn_desc_address) |
Lookup the address of the function entry point that corresponds to the address of a given function descriptor. More... | |
GElf_Addr | maybe_adjust_et_rel_sym_addr_to_abs_addr (Elf *elf_handle, GElf_Sym *sym) |
Translate a section-relative symbol address (i.e, symbol value) into an absolute symbol address by adding the address of the section the symbol belongs to, to the address value. More... | |
template<typename T > | |
bool | read_int_from_array_of_bytes (const uint8_t *bytes, unsigned char number_of_bytes, bool is_big_endian, T &result) |
Read N bytes and convert their value into an integer type T. More... | |
bool | read_uint64_from_array_of_bytes (const uint8_t *bytes, bool is_big_endian, uint64_t &result) |
Read 8 bytes and convert their value into an uint64_t. More... | |
elf_symbol::binding | stb_to_elf_symbol_binding (unsigned char stb) |
Convert an elf symbol binding (given by the ELF{32,64}_ST_BIND macros) into an elf_symbol::binding value. More... | |
elf_symbol::type | stt_to_elf_symbol_type (unsigned char stt) |
Convert an elf symbol type (given by the ELF{32,64}_ST_TYPE macros) into an elf_symbol::type value. More... | |
elf_symbol::visibility | stv_to_elf_symbol_visibility (unsigned char stv) |
Convert an ELF symbol visiblity given by the symbols ->st_other data member as returned by the GELF_ST_VISIBILITY macro into a elf_symbol::visiblity value. More... | |
This contains the definitions of the ELF utilities for the dwarf reader.
Definition in file abg-elf-helpers.cc.