summaryrefslogtreecommitdiff
path: root/test/elf/gotpcrel.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/gotpcrel.test')
-rw-r--r--test/elf/gotpcrel.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/elf/gotpcrel.test b/test/elf/gotpcrel.test
new file mode 100644
index 0000000000000..b6f83c16676d7
--- /dev/null
+++ b/test/elf/gotpcrel.test
@@ -0,0 +1,21 @@
+# This test checks that GOTPCREL entries are being handled properly
+RUN: lld -flavor gnu -target x86_64-linux -static -e main --output-filetype=yaml \
+RUN: --noinhibit-exec %p/Inputs/gotpcrel.x86-64 \
+RUN: | FileCheck %s -check-prefix=YAML
+
+YAML: name: main
+YAML: references:
+YAML: kind: R_X86_64_GOTPCREL
+YAML: offset: 3
+YAML: target: [[NULLGOT:[a-zA-Z0-9_]+]]
+YAML: kind: R_X86_64_GOTPCREL
+YAML: offset: 10
+YAML: target: [[MAINGOT:[a-zA-Z0-9_]+]]
+
+YAML: name: [[NULLGOT]]
+YAML: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ]
+YAML-NOT: references:
+
+YAML: name: [[MAINGOT]]
+YAML: kind: R_X86_64_64
+YAML: target: main