From: "jose.marchesi at oracle dot com" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/23732] Test failures on sparc64-linux-gnu
Date: Thu, 04 Oct 2018 10:19:00 -0000 [thread overview]
Message-ID: <bug-23732-10460-ta4P6lHWFX@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-23732-10460@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23732
Jose E. Marchesi <jose.marchesi at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Jose E. Marchesi <jose.marchesi at oracle dot com> ---
Allright, this turned out to be a BFD bug, not an elfutils bug.
Fixed with the binutils commit below.
Salud!
commit 6d0a6093c5fe82eb4c2b67d3d10fa44eeb0bc98b
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date: Thu Oct 4 02:12:48 2018 -0700
bfd,sparc: fix the .dynsym sh_index when stripping all symbols in ld
The SPARC ELF BFD backend uses a hack in order to accomodate the
STT_REGISTER symbols mandated by the SPARC V9 ABI for 64-bit objects.
The hack works as follows:
- Early in `size_dynamic_symbols', it adds the dynamic STT_REGISTER
symbols and the corresponding DT_SPARC_REGISTER tags if needed,
i.e. if the input object has been annotated by the assembler to use
any of the global registers requiring annotations by the ABI.
The STT_REGISTER symbols are not local, but nevertheless they are
added to the end of the dynlocal linked list (eek, yes) to be fixed
"later". This is done so the symbols are emitted in the symtab.
- Consequently, when the `sh_info' field of the .dynsym section is
calculated in `bfd_elf_final_link' to be `local_dynsymcount + 1', it
may have the wrong value, since the real first global symbol is the
first STT_REGISTER symbol.
- However, this temporary inconsistency is fixed in the
`elf64_sparc_output_arch_syms' backend hook: the sh_index is
adjusted to its rightful value. So all is well and good.
However the 2015 changeset
commit 8539e4e89eb4c54bb6668582cd709765a3803588
Author: Alan Modra <amodra@gmail.com>
Date: Thu Jan 15 19:42:59 2015 +1030
Fix ARM fail of gap test
ld-elf/gap test was failing due to the ARM backend attempting to output
arch symbols when ld -s (strip all symbols) is in force. This patch
stops that happening and tidies the code a little.
made the `elf_backend_output_arch_syms' backend hook to not be called
when all symbols are to be stripped. This resulted in an incorrect
sh_index for .dynsym when a link is performed with -s (strip_all), in
64-bit sparc ELF objects.
This patch moves the sh_index adjusting code from the target
`output_arch_syms' to `finish_dynamic_sections'. It also removes the
strip_all check from `elf64_sparc_output_arch_syms', as the function
is no longer called in that case.
Tested in sparc64-linux-gnu and sparc-linux-gnu.
No regressions observed.
bfd/ChangeLog:
2018-10-04 Jose E. Marchesi <jose.marchesi@oracle.com>
* elf64-sparc.c (elf64_sparc_output_arch_syms): Do not correct the
impact of STT_REGISTER symbols in the dynsym sh_index here...
* elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): ... but
do it here.
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2018-10-04 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 16:50 [Bug general/23732] New: " kelledin at gmail dot com
2018-10-03 12:33 ` [Bug general/23732] " jose.marchesi at oracle dot com
2018-10-04 10:19 ` jose.marchesi at oracle dot com [this message]
2023-01-14 17:13 ` sam at gentoo dot org
2023-01-18 14:41 ` sam at gentoo dot org
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=bug-23732-10460-ta4P6lHWFX@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=elfutils-devel@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).