The Git repository of the Libabigail Project
Go to file
Dodji Seketeli 06279598c8 Support reading undefined symbols from an ELF file
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>
2014-11-30 19:57:05 +01:00
doc Fix manual documentation generation 2014-11-19 21:00:50 +01:00
include Support reading undefined symbols from an ELF file 2014-11-30 19:57:05 +01:00
m4 Remove some m4 auto-generated files from version control 2014-11-05 09:59:26 +01:00
scripts Initial DOT work. 2013-07-23 23:13:55 +02:00
src Support reading undefined symbols from an ELF file 2014-11-30 19:57:05 +01:00
tests Make tests/data directory have its own Makefile 2014-11-20 11:26:30 +01:00
tools Fix status checking in abidw 2014-11-30 19:57:04 +01:00
.gitignore Update .gitignore 2014-11-01 12:10:06 +01:00
abigail.m4 For usage from within GCC set header path to $includedir/libabigail 2013-08-14 16:10:15 +02:00
AUTHORS Initial AUTHORS and README 2013-02-28 13:25:20 +01:00
changelog Implement generic diff tree walking and port categorization over it 2014-10-10 13:18:04 +02:00
ChangeLog Added a ChangeLog that is auto-generated by gen-changelog.py 2014-11-18 23:18:06 +01:00
COMMIT-LOG-GUIDELINES Allow introductory text in commit log and ignore it when generating ChangeLog 2014-11-18 23:18:06 +01:00
COMPILING White space fix in COMPILING 2013-08-22 17:40:50 +02:00
config.h.in Make the use of a C++-11 compiler optional 2014-11-05 10:45:07 +01:00
configure.ac Make tests/data directory have its own Makefile 2014-11-20 11:26:30 +01:00
CONTRIBUTING Fix checkout & build instructions 2014-01-14 15:39:34 +01:00
COPYING
COPYING-LGPLV2 Initial import of gen-changelog.py 2014-11-18 23:18:06 +01:00
COPYING-LGPLV3 LGPLv3 License the library 2013-07-23 23:13:55 +02:00
gen-changelog.py [gen-changelog] Make subject line always come first 2014-11-18 23:18:06 +01:00
install-sh Add missing autoconfiscation files into version control 2013-03-01 00:47:49 +01:00
libabigail.pc.in Make libxml2 a private dependency wrt pkconfig 2013-08-22 17:41:29 +02:00
ltmain.sh Add missing autoconfiscation files into version control 2013-03-01 00:47:49 +01:00
Makefile.am INSTALL file is not yet in the distribution 2014-11-19 10:21:06 +01:00
README Prepare for publishing 2013-07-23 23:13:55 +02:00
test21-type-suppr-0.suppr Pimplify abigail::comparison::diff type 2014-09-19 12:28:18 +02:00
test21-type-suppr-report-0.txt Pimplify abigail::comparison::diff type 2014-09-19 12:28:18 +02:00

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.