public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] Bug 29160 - support fn symbol aliasing a var symbol
Date: Mon, 08 Apr 2024 11:07:45 +0200	[thread overview]
Message-ID: <87a5m4w7by.fsf@redhat.com> (raw)

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


                 reply	other threads:[~2024-04-08  9:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5m4w7by.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).