aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/aarch64_tlsdesc.t
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2017-08-28 08:03:00 -0700
committerCary Coutant <ccoutant@gmail.com>2017-08-28 08:03:00 -0700
commitcefdd1cd64f3b67aba1b219547b8f895c22d48ed (patch)
tree1fbc8b87099dd20997e241e8057cf0b58280a25b /gold/testsuite/aarch64_tlsdesc.t
parent565ed01a4e0e3584f24580177822a5271b1c0c8b (diff)
downloadbinutils-cefdd1cd64f3b67aba1b219547b8f895c22d48ed.zip
binutils-cefdd1cd64f3b67aba1b219547b8f895c22d48ed.tar.gz
binutils-cefdd1cd64f3b67aba1b219547b8f895c22d48ed.tar.bz2
Fix bad offset calculation for R_AARCH64_TLSDESC_* relocs.
If a custom linker script with an unexpected relative layout of .got and .got.plt sections was used, gold might produce a wrong offset when applying R_AARCH64_TLSDESC_* relocations. This patch fixes the issue by calculating "got_tlsdesc_offset" in a more direct way. gold/ * aarch64.cc (Target_aarch64::Relocate::relocate_tls): Make got_tlsdesc_offset signed and fix its calculation. * testsuite/Makefile.am (aarch64_tlsdesc): New test. * testsuite/Makefile.in: Regenerate. * testsuite/aarch64_tlsdesc.s: New test source file. * testsuite/aarch64_tlsdesc.sh: New test script. * testsuite/aarch64_tlsdesc.t: New test linker script.
Diffstat (limited to 'gold/testsuite/aarch64_tlsdesc.t')
-rw-r--r--gold/testsuite/aarch64_tlsdesc.t6
1 files changed, 6 insertions, 0 deletions
diff --git a/gold/testsuite/aarch64_tlsdesc.t b/gold/testsuite/aarch64_tlsdesc.t
new file mode 100644
index 0000000..8af9cf3
--- /dev/null
+++ b/gold/testsuite/aarch64_tlsdesc.t
@@ -0,0 +1,6 @@
+SECTIONS
+{
+ .text : { *(.text) }
+ .got.plt : { *(.got.plt) }
+ .got : { *(.got) }
+}