10 #ifndef __ABG_ELF_HELPERS_H__
11 #define __ABG_ELF_HELPERS_H__
15 #include <elfutils/libdwfl.h>
31 operator()(Dwfl* dwfl)
36 typedef shared_ptr<Dwfl> dwfl_sptr;
40 typedef unordered_map<GElf_Addr, elf_symbol_sptr> addr_elf_symbol_sptr_map_type;
43 typedef unordered_set<GElf_Addr> address_set_type;
46 typedef shared_ptr<address_set_type> address_set_sptr;
53 stt_to_elf_symbol_type(
unsigned char stt);
56 stb_to_elf_symbol_binding(
unsigned char stb);
59 stv_to_elf_symbol_visibility(
unsigned char stv);
62 e_machine_to_string(GElf_Half e_machine);
69 find_section(Elf* elf_handle,
70 const std::string& name,
71 Elf64_Word section_type);
74 find_section_by_name(Elf* elf_handle,
const std::string& name);
77 find_section(Elf* elf_handle, Elf64_Word section_type);
80 find_symtab_section(Elf* elf_handle);
83 find_dynsym_section(Elf* elf_handle);
86 find_symbol_table_section(Elf* elf_handle);
89 find_symbol_table_section_index(Elf* elf_handle,
size_t& symtab_index);
93 NO_HASH_TABLE_KIND = 0,
99 find_hash_table_section_index(Elf* elf_handle,
100 size_t& ht_section_index,
101 size_t& symtab_section_index);
104 find_text_section(Elf* elf_handle);
107 find_bss_section(Elf* elf_handle);
110 find_rodata_section(Elf* elf_handle);
113 find_data_section(Elf* elf_handle);
116 find_data1_section(Elf* elf_handle);
119 find_opd_section(Elf* elf_handle);
122 get_symbol_versionning_sections(Elf* elf_handle,
123 Elf_Scn*& versym_section,
124 Elf_Scn*& verdef_section,
125 Elf_Scn*& verneed_section);
128 find_ksymtab_section(Elf* elf_handle);
131 find_ksymtab_gpl_section(Elf* elf_handle);
134 find_ksymtab_strings_section(Elf *elf_handle);
137 find_relocation_section(Elf* elf_handle, Elf_Scn* target_section);
140 find_strtab_for_symtab_section(Elf* elf_handle,
141 Elf_Scn* symtab_section);
148 get_version_definition_for_versym(Elf* elf_handle,
150 Elf_Scn* verdef_section,
154 get_version_needed_for_versym(Elf* elf_handle,
156 Elf_Scn* verneed_section,
160 get_version_for_symbol(Elf* elf_handle,
162 bool get_def_version,
166 get_crc_for_symbol(Elf* elf_handle, GElf_Sym* crc_symbol, uint32_t& crc_value);
172 architecture_is_ppc64(Elf* elf_handle);
175 architecture_is_ppc32(Elf* elf_handle);
178 architecture_is_arm32(Elf* elf_handle);
181 architecture_is_arm64(Elf* elf_handle);
184 architecture_is_big_endian(Elf* elf_handle);
187 lookup_ppc64_elf_fn_entry_point_address(Elf* elf_handle,
188 GElf_Addr fn_desc_address);
195 is_linux_kernel_module(Elf *elf_handle);
198 is_linux_kernel(Elf *elf_handle);
204 const Dwfl_Callbacks&
205 initialize_dwfl_callbacks(Dwfl_Callbacks&,
char**);
208 create_new_dwfl_handle(Dwfl_Callbacks&);
215 get_binary_load_address(Elf* elf_handle, GElf_Addr& load_address);
218 get_architecture_word_size(Elf* elf_handle);
221 is_executable(Elf* elf_handle);
224 is_dso(Elf* elf_handle);
227 maybe_adjust_et_rel_sym_addr_to_abs_addr(Elf* elf_handle, GElf_Sym* sym);
230 address_is_in_opd_section(Elf* elf_handle, Dwarf_Addr addr);
233 lookup_data_tag_from_dynamic_segment(Elf* elf,
234 Elf64_Sxword data_tag,
235 vector<string>& dt_tag_data);
238 get_soname_of_elf_file(
const string& path,
string &soname);
242 #endif // __ABG_ELF_HELPERS_H__
visibility
The visibility of the symbol.
Toplevel namespace for libabigail.
Types of the main internal representation of libabigail.
A functor used by dwfl_sptr.
type
The type of a symbol.
binding
The binding of a symbol.
The abstraction of the version of an ELF symbol.