aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-aarch64
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2016-11-10 09:25:17 +0000
committerJiong Wang <jiong.wang@arm.com>2016-11-10 09:25:17 +0000
commitac33b731d214d79738ca04d27f7464d4482f6a01 (patch)
tree896ece5b0fd3bab286cc4443c7c9d5187dd020db /ld/testsuite/ld-aarch64
parent9b9720149dfee4a9a961c29d0382fc5bdf9c975b (diff)
downloadgdb-ac33b731d214d79738ca04d27f7464d4482f6a01.zip
gdb-ac33b731d214d79738ca04d27f7464d4482f6a01.tar.gz
gdb-ac33b731d214d79738ca04d27f7464d4482f6a01.tar.bz2
[AArch64] Bind defined symbol locally in PIE
bfd/ PR target/20737 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Bind defined symbol locally in PIE. ld/ * testsuite/ld-aarch64/pie-bind-locally-a.s: New test source. * testsuite/ld-aarch64/pie-bind-locally-b.s: Likewise. * testsuite/ld-aarch64/pie-bind-locally.d: New testcase. * testsuite/ld-aarch64/aarch64-elf.exp: Run new testcase.
Diffstat (limited to 'ld/testsuite/ld-aarch64')
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp2
-rw-r--r--ld/testsuite/ld-aarch64/pie-bind-locally-a.s5
-rw-r--r--ld/testsuite/ld-aarch64/pie-bind-locally-b.s6
-rw-r--r--ld/testsuite/ld-aarch64/pie-bind-locally.d9
4 files changed, 22 insertions, 0 deletions
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index ab84f01..d4d7f5a 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -287,6 +287,8 @@ run_dump_test "rela-abs-relative"
run_dump_test "rela-abs-relative-be"
run_dump_test "rela-abs-relative-opt"
+run_dump_test "pie-bind-locally"
+
set aarch64elflinktests {
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
{} "copy-reloc-so.so"}
diff --git a/ld/testsuite/ld-aarch64/pie-bind-locally-a.s b/ld/testsuite/ld-aarch64/pie-bind-locally-a.s
new file mode 100644
index 0000000..f64d48d
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/pie-bind-locally-a.s
@@ -0,0 +1,5 @@
+ .text
+ .align 2
+ .global _start
+_start:
+ ldr x0, [x0, #:got_lo12:_start]
diff --git a/ld/testsuite/ld-aarch64/pie-bind-locally-b.s b/ld/testsuite/ld-aarch64/pie-bind-locally-b.s
new file mode 100644
index 0000000..6083941
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/pie-bind-locally-b.s
@@ -0,0 +1,6 @@
+ .section .data.rel,"aw",%progbits
+ .align 3
+ .type q, %object
+ .size q, 8
+q:
+ .xword _start
diff --git a/ld/testsuite/ld-aarch64/pie-bind-locally.d b/ld/testsuite/ld-aarch64/pie-bind-locally.d
new file mode 100644
index 0000000..3689543
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/pie-bind-locally.d
@@ -0,0 +1,9 @@
+#source: pie-bind-locally-a.s
+#source: pie-bind-locally-b.s
+#ld: -pie
+#readelf: -Wr
+
+Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_RELATIVE[ ].*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_RELATIVE[ ].*