libabigail/tests
Sinny Kumari 8944ceb9ef Bug 19961 - Distinguish between PI executable and shared library
In the ELF format, Position Independent Executables (aka PIE) and
shared libraries are marked as being of type ET_DYN.  So just looking
at the type of the ELF file is not enough to discriminate a position
independent executable from a shared library.

And this is the problem.  Libabigail just looks at the type of the ELF
file to discriminate PIE binaries from shared libraries binaries.

So it treats both kinds of binaries as being shared libraries.  When
we run abipkgdiff with the --dso-only option, the tool considers both
PIEs and shared libraries, even though the intent of the --dso-only
option is have the tool consider shared libraries only.

With this patch, we introduce a new enumerator ELF_TYPE_PI_EXEC (to
the elf_type enum) for PIE binaries.  From now on, a file will be
properly recognized as being of the ELF_TYPE_DSO kind only if it is a
shared library.

	* include/abg-dwarf-reader.h (elf_type): Add new enumerator
	ELF_TYPE_PI_EXEC.
	* src/abg-dwarf-reader.cc
	(lookup_data_tag_from_dynamic_segment): New function for
	data tag lookup in dynamic segment of an elf
	(elf_file_type): Return ELF_TYPE_PI_EXEC file type for
	a PI executable.
	(get_elf_file_type): Change this to take an elf handle.
	(get_type_of_elf_file): New function that got factorized out of ...
	(load_dt_soname_and_needed): ... this one.
	* tools/abipkgdiff.cc (create_maps_of_package_content): Also
	consider ELF_TYPE_PI_EXEC file type.
	(compare): Likewise.
	* tests/test-diff-pkg.cc (in_out_specs): Test case additions
	* tests/data/Makefile.am: Include test files
	* tests/data/test-diff-pkg/tarpkg-1-dir1.tar.gz: New test data
	* tests/data/test-diff-pkg/tarpkg-1-dir2.tar.gz: New test data
	* tests/data/test-diff-pkg/tarpkg-1-report-0.txt: New test result

Signed-off-by: Sinny Kumari <sinny@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-20 17:05:16 +02:00
..
data Bug 19961 - Distinguish between PI executable and shared library 2016-04-20 17:05:16 +02:00
Makefile.am Bug 19596 - Incorrect exit status for incompatible ABI change 2016-02-10 21:31:53 +01:00
print-diff-tree.cc Introduce the concept of environment 2015-09-07 23:35:29 +02:00
runtestcanonicalizetypes.sh.in Fix the new regression test for type canonicalizing 2015-02-19 11:44:19 +01:00
test-abicompat.cc Fix synthesizing of reference type 2016-02-04 11:26:22 +01:00
test-abidiff-exit.cc Bug 19596 - Suppressed removed symbol changes still considered incompatible 2016-03-04 01:02:46 +01:00
test-abidiff.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-alt-dwarf-file.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-core-diff.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff2.cc Update copyright years 2015-01-07 17:52:10 +01:00
test-diff-dwarf-abixml.cc Use proper WIFEXITED and WEXITSTATUS macros to get exit code 2016-02-10 22:06:01 +01:00
test-diff-dwarf.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-diff-filter.cc Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64 2016-03-30 20:17:42 +02:00
test-diff-pkg.cc Bug 19961 - Distinguish between PI executable and shared library 2016-04-20 17:05:16 +02:00
test-diff-suppr.cc Ease use of soname_regexp/file_name_regexp in suppr specs 2016-04-16 21:47:20 +02:00
test-dot.cc Correct DOT merge. 2013-07-23 23:13:55 +02:00
test-ir-walker.cc Introduce the concept of environment 2015-09-07 23:35:29 +02:00
test-lookup-syms.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-read-dwarf.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-read-write.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-svg.cc Add svg generation. 2013-07-23 23:13:54 +02:00
test-types-stability.cc Bug 19204 - libabigail aborts on DWARF referencing non-existing DIE 2016-01-21 10:48:32 +01:00
test-utils.cc Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-utils.h Use worker threads pattern to speed up some tests 2016-01-18 18:23:18 +01:00
test-write-read-archive.cc Fix archive writing support 2015-04-24 19:59:19 +02:00
update-test-read-dwarf-output.py Add a script to update the reference output of runtestreaddwarf 2015-10-17 16:20:58 +02:00