aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf/pic-reloc-5.s
diff options
context:
space:
mode:
authorFaraz Shahbazker <fshahbazker@wavecomp.com>2019-05-18 01:19:04 -0700
committerFaraz Shahbazker <fshahbazker@wavecomp.com>2019-05-21 11:55:08 -0700
commitb474a2022dc14fea0dd8ea4cc66b813486132075 (patch)
tree0fe5db1c7c9c7dbe2899109aec52a5f63d624539 /ld/testsuite/ld-mips-elf/pic-reloc-5.s
parent304f09d0d4b519f143144d213e1280a0691de8ba (diff)
downloadgdb-b474a2022dc14fea0dd8ea4cc66b813486132075.zip
gdb-b474a2022dc14fea0dd8ea4cc66b813486132075.tar.gz
gdb-b474a2022dc14fea0dd8ea4cc66b813486132075.tar.bz2
MIPS/LD: Reject tprel_hi and tprel_lo relocations in shared library
bfd/ * elfxx-mips.c (_bfd_mips_elf_check_relocs): Generate error for TLS_TPREL_HI16(/LO16) relocations in shared library. ld/ * testsuite/ld-mips-elf/pic-reloc-5.s: Add tests for %tprel_hi and %tprel_lo relocations. * testsuite/ld-mips-elf/pic-reloc-6.s: Likewise. * testsuite/ld-mips-elf/pic-reloc-5.d: Update accordingly. * testsuite/ld-mips-elf/pic-reloc-6.d: Likewise. * testsuite/ld-mips-elf/pic-reloc-tls.ld: New test linker script file.
Diffstat (limited to 'ld/testsuite/ld-mips-elf/pic-reloc-5.s')
-rw-r--r--ld/testsuite/ld-mips-elf/pic-reloc-5.s12
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/testsuite/ld-mips-elf/pic-reloc-5.s b/ld/testsuite/ld-mips-elf/pic-reloc-5.s
index b8ebd8c..456d834 100644
--- a/ld/testsuite/ld-mips-elf/pic-reloc-5.s
+++ b/ld/testsuite/ld-mips-elf/pic-reloc-5.s
@@ -1,5 +1,6 @@
.text
.globl foo
+ .globl global_tls
.ent foo
foo:
$LCL:
@@ -7,4 +8,15 @@ $LCL:
addiu $2, %lo($LCL)
lui $2, %hi(bar)
addiu $2, %lo(bar)
+ lui $a0,%tprel_hi(local_tls)
+ addiu $a0,$a0,%tprel_lo(local_tls)
+ lui $a0,%tprel_hi(global_tls)
+ addiu $a0,$a0,%tprel_lo(global_tls)
.end foo
+ .type local_tls,%object
+ .type global_tls,%object
+ .section .tbss,"awT",@nobits
+local_tls:
+ .word
+global_tls:
+ .word