[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries |
Date: |
Wed, 28 Mar 2018 10:20:59 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22972
--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot
gnu.org> ---
The master branch has been updated by Eric Botcazou <address@hidden>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f8745e1cd139b5c6a5bd8a30ea84ccbd45dec81c
commit f8745e1cd139b5c6a5bd8a30ea84ccbd45dec81c
Author: Eric Botcazou <address@hidden>
Date: Wed Mar 28 12:17:15 2018 +0200
PR ld/22972 on SPARC.
This is a regression for the corner case of a hidden symbol in a PIC/PIE
binary which is subject to both a new-style GOTDATA relocation and an
old-style GOT relocation. In this case, depending on the link order,
the R_SPARC_RELATIVE dynamic relocation for the GOT slot needed because
of the old-style relocation can be replaced with R_SPARC_NONE coming
from the GOTDATA relocation.
The fix simply records whether an old-style GOT relocation is seen for a
symbol and prevents the R_SPARC_NONE from being generated in this case.
bfd/
* elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
has_old_style_got_reloc.
(_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
relocations. Fix a couple of long lines.
(_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
a R_SPARC_NONE for the GOT slot if the symbol is also subject to
old-style GOT relocations.
ld/
* testsuite/ld-sparc/sparc.exp: Add test for mixed GOTDATA/GOT relocs.
* testsuite/ld-sparc/gotop-hidden.c: New file.
* testsuite/ld-sparc/got-hidden32.s: Likewise.
* testsuite/ld-sparc/got-hidden64.s: Likewise.
* testsuite/ld-sparc/pass.out: Likewise.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22972] New: [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, jrtc27 at jrtc27 dot com, 2018/03/14
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, ebotcazou at gcc dot gnu.org, 2018/03/15
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, jrtc27 at jrtc27 dot com, 2018/03/15
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, ebotcazou at gcc dot gnu.org, 2018/03/15
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries,
cvs-commit at gcc dot gnu.org <=
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, cvs-commit at gcc dot gnu.org, 2018/03/28
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, cvs-commit at gcc dot gnu.org, 2018/03/28
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, ebotcazou at gcc dot gnu.org, 2018/03/28
- [Bug ld/22972] [SPARC] Mixing GOT and GOTDATA_OP relocations can lead to broken binaries, jeremip11 at gmail dot com, 2018/03/31