aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-05-03 17:17:46 +0100
committerMaciej W. Rozycki <macro@mips.com>2018-05-03 17:17:46 +0100
commit3be08ea4728b56d35e136af4e6fd3086ade17764 (patch)
tree0982e7e0d5c68f187b90bc0967cf7402793f6eb6 /ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd
parentbd732259bd3bec9494a2f1f39f74255dd4a9be85 (diff)
downloadgdb-3be08ea4728b56d35e136af4e6fd3086ade17764.zip
gdb-3be08ea4728b56d35e136af4e6fd3086ade17764.tar.gz
gdb-3be08ea4728b56d35e136af4e6fd3086ade17764.tar.bz2
BFD: Prevent writing the MIPS _gp_disp symbol into symbol tables
The _gp_disp is a magic symbol, always implicitly defined by the linker. It does not make a sense to write it into symbol tables for output files. Moreover, now if the linker gets a version script, the _gp_disp symbol gets zero version definition index. The zero index means[1]: "The symbol is local, not available outside the object." But the _gp_disp symbol has GLOBAL binding. That confuses some tools like for example the LLD linker when they get such files as inputs. This patch fixes the problem - it prevents writing the _gp_disp symbol in regular and dynamic symbol tables. This was tested by running LD test suite on a mipsel-linux board. References: [1] "Linux Standard Base Specification", Section "10.7.2 Symbol Version Table", p. 32 2018-05-03 Simon Atanasyan <simon@atanasyan.com> bfd/ * elf32-mips.c: (elf32_mips_fixup_symbol): New function. (elf_backend_fixup_symbol): New macro. * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp handling. (_bfd_mips_elf_finish_dynamic_symbol): Likewise. ld/ * testsuite/ld-mips-elf/gp-disp-sym.d: New test. * testsuite/ld-mips-elf/gp-disp-sym.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new test. * testsuite/ld-mips-elf/mips16-pic-2.ad: Update for _gp_disp symbol removal. * testsuite/ld-mips-elf/mips16-pic-2.nd: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-3a.dd: Likewise. * testsuite/ld-mips-elf/tlslib-o32-hidden.got: Likewise. * testsuite/ld-mips-elf/tlslib-o32-ver.got: Likewise. * testsuite/ld-mips-elf/tlslib-o32.got: Likewise.
Diffstat (limited to 'ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd')
-rw-r--r--ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd2
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd b/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd
index 3dcfe12..b286f13 100644
--- a/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd
+++ b/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd
@@ -35,5 +35,5 @@ Disassembly of section \.MIPS\.stubs:
c00: 8f998010 lw t9,-32752\(gp\)
c04: 03e07825 move t7,ra
c08: 0320f809 jalr t9
- c0c: 24180005 li t8,5
+ c0c: 24180004 li t8,4
\.\.\.