public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Bug 27204 -  potential loss of some aliased ELF function symbols
@ 2021-01-24 11:54 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2021-01-24 11:54 UTC (permalink / raw)
  To: libabigail

Hello,

Sometimes when a symbol S' of a function F' aliases the symbol S of a function
F, the ABIXML reader might not add F' back into the set of exported
functions of the ABI corpus (as the DWARF reader has done initially).
That results in the apparent 'loss' of F' (and S') from the corpus.

This is due to the way F' is identified, using function_decl::get_id.
In the case where the symbol S' of F' has aliases,
function_decl::get_id (wrongly) uses the linkage name of F' as the
identifier.  If F' and F happen to have the same linkage name and if F
is already in the set of exported functions of the corpus then F'
won't be added into that set.

To solve that problem, this patch makes function_decl::get_id
construct an ID that ensures that F and F' always have different IDs.

	* src/abg-ir.cc (function_decl::get_id): If the elf symbol has
	aliases, make the function name be part of the ID so that this ID
	differs from the one of the other functions that share a symbol
	alias with this one.
	* tests/data/test-abidiff/test-PR18791-report0.txt: Adjust.
	* tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt: Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test41-report-0.txt: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-diff-pkg/glibc-2.32-3.fc33.aarch64-self-check-report-0.txt:
	New test reference output.
	* tests/data/test-diff-pkg/glibc-2.32-3.fc33.aarch64.rpm: New test
	input RPM.
	* tests/data/test-diff-pkg/glibc-debuginfo-2.32-3.fc33.aarch64.rpm:
	Likewise.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.
	* tests/test-diff-pkg.cc (in_out_specs): Add the new test input
	RPMs to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>

Applied to master.

---
 src/abg-ir.cc                                 |   7 +--
 tests/data/Makefile.am                        |   3 ++
 .../test-abidiff/test-PR18791-report0.txt     |  45 +++++++++++++++-
 .../test42-PR21296-clanggcc-report0.txt       |  40 ++-------------
 .../test31-pr18535-libstdc++-report-0.txt     |   2 +-
 .../test31-pr18535-libstdc++-report-1.txt     |   2 +-
 .../data/test-diff-filter/test41-report-0.txt |  18 +------
 ....32-3.fc33.aarch64-self-check-report-0.txt |  28 ++++++++++
 .../glibc-2.32-3.fc33.aarch64.rpm             | Bin 0 -> 3526320 bytes
 .../glibc-debuginfo-2.32-3.fc33.aarch64.rpm   | Bin 0 -> 18049871 bytes
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |   2 +-
 .../test-read-dwarf/test16-pr18904.so.abi     |  48 +++++++++---------
 tests/test-diff-pkg.cc                        |  13 +++++
 13 files changed, 124 insertions(+), 84 deletions(-)
 create mode 100644 tests/data/test-diff-pkg/glibc-2.32-3.fc33.aarch64-self-check-report-0.txt
 create mode 100644 tests/data/test-diff-pkg/glibc-2.32-3.fc33.aarch64.rpm
 create mode 100644 tests/data/test-diff-pkg/glibc-debuginfo-2.32-3.fc33.aarch64.rpm


The patch is too big for the mailing list.  It can however be browsed at
https://sourceware.org/git/?p=libabigail.git;a=commit;h=1dcdd54d5494f25509e48c92409d9fc321733ba0.

Cheers,

-- 
		Dodji


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-24 11:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 11:54 [PATCH] Bug 27204 - potential loss of some aliased ELF function symbols Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).