summaryrefslogtreecommitdiff
path: root/test/ELF/aarch64-data-relocs.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:57:38 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:57:38 +0000
commit5a5c549fe9a3fef595297bd21d36bed8409dc37d (patch)
treea964c8f5ac85b7b641cac022c5f9bf4eed3d2b9b /test/ELF/aarch64-data-relocs.s
parentfb911942f1434f3d1750f83f25f5e42c80e60638 (diff)
Notes
Diffstat (limited to 'test/ELF/aarch64-data-relocs.s')
-rw-r--r--test/ELF/aarch64-data-relocs.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ELF/aarch64-data-relocs.s b/test/ELF/aarch64-data-relocs.s
new file mode 100644
index 0000000000000..30770836f7870
--- /dev/null
+++ b/test/ELF/aarch64-data-relocs.s
@@ -0,0 +1,23 @@
+// RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %s -o %t
+// RUN: llvm-mc -filetype=obj -triple=aarch64-none-freebsd %S/Inputs/abs256.s -o %t256.o
+// RUN: ld.lld %t %t256.o -o %t2
+// RUN: llvm-objdump -s %t2 | FileCheck %s
+// REQUIRES: aarch64
+
+.globl _start
+_start:
+.section .R_AARCH64_ABS64, "ax",@progbits
+ .xword foo + 0x24
+
+// S = 0x100, A = 0x24
+// S + A = 0x124
+// CHECK: Contents of section .R_AARCH64_ABS64:
+// CHECK-NEXT: 11000 24010000 00000000
+
+.section .R_AARCH64_PREL64, "ax",@progbits
+ .xword foo - . + 0x24
+
+// S = 0x100, A = 0x24, P = 0x11008
+// S + A - P = 0xfffffffffffef11c
+// CHECK: Contents of section .R_AARCH64_PREL64:
+// CHECK-NEXT: 11008 1cf1feff ffffffff