public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] Bug 29160 - support fn symbol aliasing a var symbol
@ 2024-04-08  9:07 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2024-04-08  9:07 UTC (permalink / raw)
  To: libabigail

Hello,

In binaries originating from OCaml on s390x or ppcle platforms, it can
happen that a function symbol aliases a variable symbol.

By default, the ABIXML reader doesn't expect that.  It expects that
all aliases of a symbol are symbols of the same kind as their target.

This patch relaxes that constraint from the ABIXML reader.  It teaches
read_symbol_db_from_input how to resolve unresolved function (resp.
variable) symbol aliases to variable (resp. function) symbols.

	* src/abg-reader.cc (typedef string_strings_map_type): Define new
	typedef.
	(resolve_symbol_aliases): Define new function.
	(build_elf_symbol_db): Add two new parameters to carry unresolved
	function and variable symbol aliases.  When a symbol alias can't
	resolve to any of the symbols of its kind (function or variable)
	then stage the alias away in the set of unresolved aliases.  That
	set is then going to be resolved later.
	(read_symbol_db_from_input): Add two new parameters to carry
	unresolved function and variable symbol aliases.  Pass them down
	to build_elf_symbol_db.
	(reader::read_corpus): Adjust the invocation of
	read_symbol_db_from_input to get the sets of unresolved function &
	variable symbol aliases.  Invoke the new resolve_symbol_aliases
	the unresolved function & variable aliases.
	* tests/data/test-diff-pkg/PR29610/guestfs-tools-1.51.6-2.el9.s390x-self-check-report.txt:
	New test reference output.
	* tests/data/test-diff-pkg/PR29610/guestfs-tools-1.51.6-2.el9.s390x.rpm:
	New binary test input.
	* tests/data/test-diff-pkg/PR29610/guestfs-tools-debuginfo-1.51.6-2.el9.s390x.rpm:
	Likewise.
	* tests/data/Makefile.am: Add this new test material to source
	distribution.
	* tests/test-diff-pkg.cc (in_out_specs): Add the new test input to
	this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to the master branch.
---
 src/abg-reader.cc                             | 210 ++++++++++++++++--
 tests/data/Makefile.am                        |   4 +
 ...s-1.51.6-2.el9.s390x-self-check-report.txt |  21 ++
 .../guestfs-tools-1.51.6-2.el9.s390x.rpm      | Bin 0 -> 3924825 bytes
 ...tfs-tools-debuginfo-1.51.6-2.el9.s390x.rpm | Bin 0 -> 1374181 bytes
 tests/test-diff-pkg.cc                        |  12 +
 6 files changed, 226 insertions(+), 21 deletions(-)
 create mode 100644 tests/data/test-diff-pkg/PR29610/guestfs-tools-1.51.6-2.el9.s390x-self-check-report.txt
 create mode 100644 tests/data/test-diff-pkg/PR29610/guestfs-tools-1.51.6-2.el9.s390x.rpm
 create mode 100644 tests/data/test-diff-pkg/PR29610/guestfs-tools-debuginfo-1.51.6-2.el9.s390x.rpm

The patch is too big to be attached here, even if gzipped.  You can
however read it and get it from Git at https://sourceware.org/git/?p=libabigail.git;a=commit;h=a82958b3f5b64732ef95836671d701c008c3072b.

Cheers,

-- 
		Dodji


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

only message in thread, other threads:[~2024-04-08  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08  9:07 [PATCH, applied] Bug 29160 - support fn symbol aliasing a var symbol 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).