mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-23 18:22:08 +00:00
The Git repository of the Libabigail Project
06279598c8
In preparation to support the upcoming 'abicompat' tool, we need the ABI corpus type to capture the symbols that are undefined in a given ELF file. This patch changes the ELF reader to capture the undefined symbols as well as the symbol versions they need to be satisfied. These undefined symbols are then stored in the instance ABI corpus build as a result of the reading of the ELF file. At the moment, these undefined symbols are not serialized to the native XML format of libabigail yet. I guess I'll do that in a subsequent patch. * include/abg-corpus.h (corpus::{set_undefined_fun_symbol_map, set_undefined_var_symbol_map, get_undefined_fun_symbol_map_sptr, get_undefined_fun_symbol_map, get_sorted_undefined_fun_symbols, get_undefined_var_symbol_map_sptr, get_undefined_var_symbol_map, get_sorted_undefined_var_symbols}): Declare new methods ... * src/abg-corpus.cc (corpus::{set_undefined_fun_symbol_map, set_undefined_var_symbol_map, get_undefined_fun_symbol_map_sptr, get_undefined_fun_symbol_map, get_sorted_undefined_fun_symbols, get_undefined_var_symbol_map_sptr, get_undefined_var_symbol_map, get_sorted_undefined_var_symbols}): ... and define them. (struct corpus::priv::{undefined_var_symbol_map, sorted_undefined_var_symbols, undefined_fun_symbol_map, sorted_undefined_fun_symbols}): New data members. * src/abg-dwarf-reader.cc (get_symbol_versionning_sections): Also return the SHT_GNU_verneed section. (get_version_needed_for_versym): New static function. (get_version_definition_for_versym): Factorize this function out of .. (get_version_for_symbol): ... this one. Take a flag that says if we want the definition version or the needed version of a symbol. Extend the implementation using the two new function get_version_needed_for_versym() and get_version_definition_for_versym() above. This function now returns the version either for a defined & exported symbol, or for an undefined symbol. (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab): Adjust for the change of signature of get_version_for_symbol(). (read_context::{undefined_fun_syms_, undefined_var_syms_}): New data members. (read_context::lookup_elf_symbol_from_index): Adjust for invocation of the new signature of get_version_for_symbol(). (read_context::{undefined_fun_syms_sptr, undefined_fun_syms, undefined_var_syms_sptr, undefined_var_syms}): Define new methods. (read_context::load_symbol_maps): Add support for loading undefined symbols and their versions. (read_context::maybe_load_symbol_maps): Take in account the need to load undefined symbols as well. (read_corpus_from_elf): Once the undefined symbols have been read from the ELF file, stuff them into the resulting ABI corpus that has been built. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
doc | ||
include | ||
m4 | ||
scripts | ||
src | ||
tests | ||
tools | ||
.gitignore | ||
abigail.m4 | ||
AUTHORS | ||
changelog | ||
ChangeLog | ||
COMMIT-LOG-GUIDELINES | ||
COMPILING | ||
config.h.in | ||
configure.ac | ||
CONTRIBUTING | ||
COPYING | ||
COPYING-LGPLV2 | ||
COPYING-LGPLV3 | ||
gen-changelog.py | ||
install-sh | ||
libabigail.pc.in | ||
ltmain.sh | ||
Makefile.am | ||
README | ||
test21-type-suppr-0.suppr | ||
test21-type-suppr-report-0.txt |
This is the Application Binary Interface Generic Analysis and Instrumentation Library. It aims at constructing, manipulating, serializing and de-serializing ABI-relevant artifacts. The set of artifacts that we are intersted is made of quantities like types, variable, fonctions and declarations of a given library or program. For a given library or program this set of quantities is called an ABI corpus. This library aims at (among other things) providing a way to comparing two ABI Corpuses, provide detailed information about their differences, and help build tools to infer interesting conclusions about these differences. You are welcome to contribute to this project after reading the files CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree. Communicating with the maintainers of this project -- including sending patches to be include to the source code -- happens via email at libabigail@sourceware.org.