summaryrefslogtreecommitdiff
path: root/test/old-elf/X86_64/extern-tls.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/X86_64/extern-tls.test')
-rw-r--r--test/old-elf/X86_64/extern-tls.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/old-elf/X86_64/extern-tls.test b/test/old-elf/X86_64/extern-tls.test
new file mode 100644
index 000000000000..d22b06057a9a
--- /dev/null
+++ b/test/old-elf/X86_64/extern-tls.test
@@ -0,0 +1,16 @@
+# This tests verifies that TLS variables have correct offsets
+# when variables the TLS variables are not defined in the program
+RUN: lld -flavor old-gnu -target x86_64-linux %p/Inputs/externtls.x86-64 -static \
+RUN: --output-filetype=yaml --noinhibit-exec | FileCheck %s -check-prefix=CHECKGOT
+
+# Currently x86_64 relocation pass handles the R_X86_64_GOTTPOFF by
+# creatng R_X86_64_TPOFF64 dynamic ones. For output yaml, this is
+# not changed.
+ - name: __got_tls_extern_tls
+CHECKGOT: alignment: 4
+CHECKGOT: section-name: .text
+CHECKGOT: references:
+CHECKGOT: - kind: R_X86_64_GOTTPOFF
+CHECKGOT: offset: 7
+CHECKGOT: target: extern_tls
+CHECKGOT: addend: -4