From: Mark Wielaard <mark@klomp.org>
To: libabigail@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] symtab-reader: Setup aliases before checking ppc64 opd function entries
Date: Mon, 2 May 2022 00:16:47 +0200 [thread overview]
Message-ID: <1651443407-13798-1-git-send-email-mark@klomp.org> (raw)
The update_function_entry_address_symbol_map function checks whether
the given symbol is an alias of another symbol or a special ppc64
ELFv1 function entry symbol. This requires the symbol aliases to
already been setup. But the alias entries were only setup after
calling update_function_entry_address_symbol_map. Make sure that
the symbol aliases have been setup and only then call the special
ppc64 update_function_entry_address_symbol_map function. But make
sure the arm32 function symbol entry address cleanup is done before
checking for aliases.
This fixes runtestslowselfcompare.sh on ppc64 (ELFv1) with
ENABLE_SLOW_TEST=yes
* src/abg-symtab-reader.cc (symtab::load_): Call
update_function_entry_address_symbol_map after setting
up aliases.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/abg-symtab-reader.cc | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/abg-symtab-reader.cc b/src/abg-symtab-reader.cc
index b42ce87..0f7ace9 100644
--- a/src/abg-symtab-reader.cc
+++ b/src/abg-symtab-reader.cc
@@ -352,16 +352,13 @@ symtab::load_(Elf* elf_handle,
sym);
// See also symtab::add_alternative_address_lookups.
- if (symbol_sptr->is_function())
+ // Note, do this before setting up aliases
+ if (symbol_sptr->is_function() && is_arm32)
{
- if (is_arm32)
- // Clear bit zero of ARM32 addresses as per "ELF for the Arm
- // Architecture" section 5.5.3.
- // https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
- symbol_value &= ~1;
- else if (is_ppc64)
- update_function_entry_address_symbol_map(elf_handle, sym,
- symbol_sptr);
+ // Clear bit zero of ARM32 addresses as per "ELF for the Arm
+ // Architecture" section 5.5.3.
+ // https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
+ symbol_value &= ~1;
}
const auto result =
@@ -371,6 +368,14 @@ symtab::load_(Elf* elf_handle,
// means this symbol is an alias of the main symbol with
// that address. So let's register this new alias as such.
result.first->second->get_main_symbol()->add_alias(symbol_sptr);
+
+ // See also symtab::add_alternative_address_lookups.
+ // Note, do this after setting up aliases.
+ if (symbol_sptr->is_function() && is_ppc64)
+ {
+ update_function_entry_address_symbol_map(elf_handle, sym,
+ symbol_sptr);
+ }
}
}
--
1.8.3.1
next reply other threads:[~2022-05-01 22:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-01 22:16 Mark Wielaard [this message]
2022-05-16 9:43 Dodji Seketeli
2022-05-17 9:59 ` Mark Wielaard
2022-05-17 13:51 ` Giuliano Procida
2022-05-17 14:03 ` Mark Wielaard
2022-05-27 16:33 ` Dodji Seketeli
2022-05-27 23:05 ` Mark Wielaard
2022-05-30 8:44 ` Dodji Seketeli
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=1651443407-13798-1-git-send-email-mark@klomp.org \
--to=mark@klomp.org \
--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).