aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-aarch64/relr-data.s
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2024-05-22 16:52:11 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2024-05-31 09:47:50 +0100
commit5df6499c83896c243073d8cad8c5830f89436bd6 (patch)
treeadabb39ea30301b2017f9a7c6fa53160ead05fea /ld/testsuite/ld-aarch64/relr-data.s
parenta71d87680110d854f966d8cda0f1c7887001fcdd (diff)
downloadbinutils-5df6499c83896c243073d8cad8c5830f89436bd6.zip
binutils-5df6499c83896c243073d8cad8c5830f89436bd6.tar.gz
binutils-5df6499c83896c243073d8cad8c5830f89436bd6.tar.bz2
aarch64: Add some DT_RELR ld tests
Diffstat (limited to 'ld/testsuite/ld-aarch64/relr-data.s')
-rw-r--r--ld/testsuite/ld-aarch64/relr-data.s71
1 files changed, 71 insertions, 0 deletions
diff --git a/ld/testsuite/ld-aarch64/relr-data.s b/ld/testsuite/ld-aarch64/relr-data.s
new file mode 100644
index 0000000..93b401e
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/relr-data.s
@@ -0,0 +1,71 @@
+// Test symbol references in .data when used with DT_RELR.
+// Relocations for unaligned sections are currently not packed.
+
+.text
+.global _start
+_start:
+ nop
+
+sym_local:
+ nop
+
+.global sym_hidden
+.hidden sym_hidden
+sym_hidden:
+ nop
+
+.global sym_global
+sym_global:
+ nop
+
+.global sym_global_abs
+.set sym_global_abs, 42
+
+.global sym_weak_undef
+.weak sym_weak_undef
+
+.section .data.unaligned_local
+unaligned_local:
+.xword sym_local
+
+.section .data.unaligned_hidden
+unaligned_hidden:
+.xword sym_hidden
+
+.section .data.unaligned_global
+unaligned_global:
+.xword sym_global
+
+.section .data.unaligned_DYNAMIC
+unaligned_DYNAMIC:
+.xword _DYNAMIC
+
+.section .data.aligned_local
+.p2align 1
+aligned_local:
+.xword sym_local
+
+.section .data.aligned_hidden
+.p2align 1
+aligned_hidden:
+.xword sym_hidden
+
+.section .data.aligned_global
+.p2align 1
+aligned_global:
+.xword sym_global
+
+.section .data.aligned_global_abs
+.p2align 1
+aligned_global_abs:
+.xword sym_global_abs
+
+.section .data.aligned_weak_undef
+.p2align 1
+aligned_weak_undef:
+.xword sym_weak_undef
+
+.section .data.aligned_DYNAMIC
+.p2align 1
+aligned_DYNAMIC:
+.xword _DYNAMIC