mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-16 15:04:46 +00:00
8944ceb9ef
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> |
||
---|---|---|
.. | ||
data | ||
Makefile.am | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-core-diff.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-ir-walker.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-write-read-archive.cc | ||
update-test-read-dwarf-output.py |