aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-arm
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2016-11-24 14:01:53 +0000
committerJiong Wang <jiong.wang@arm.com>2016-11-24 14:01:53 +0000
commit1dcb9720d62cd053a72c31881b7724ce9f74332c (patch)
tree0717063f07a5d5a9860159ac7c92167d5afac5bc /ld/testsuite/ld-arm
parent51750acd087cc20ae3f72393fa897d9e3059c65d (diff)
downloadgdb-1dcb9720d62cd053a72c31881b7724ce9f74332c.zip
gdb-1dcb9720d62cd053a72c31881b7724ce9f74332c.tar.gz
gdb-1dcb9720d62cd053a72c31881b7724ce9f74332c.tar.bz2
[ARM] Bind defined symbol locally in PIE
bfd/ PR target/20737 * elf32-arm.c (elf32_arm_final_link_relocate): Bind defined symbol locally in PIE. ld/ * testsuite/ld-arm/pie-bind-locally-a.s: New test source. * testsuite/ld-arm/pie-bind-locally-b.s: Likewise. * testsuite/ld-arm/pie-bind-locally.d: New testcase. * testsuite/ld-arm/arm-elf.exp: Run new testcase.
Diffstat (limited to 'ld/testsuite/ld-arm')
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp1
-rw-r--r--ld/testsuite/ld-arm/pie-bind-locally-a.s5
-rw-r--r--ld/testsuite/ld-arm/pie-bind-locally-b.s6
-rw-r--r--ld/testsuite/ld-arm/pie-bind-locally.d9
4 files changed, 21 insertions, 0 deletions
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 02a35f4..2b1e5b8 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -345,6 +345,7 @@ run_dump_test "movw-shared-3"
run_dump_test "movw-shared-4"
run_dump_test "rel32-reject"
run_dump_test "rel32-reject-pie"
+run_dump_test "pie-bind-locally"
# Exclude non-ARM-EABI targets.
diff --git a/ld/testsuite/ld-arm/pie-bind-locally-a.s b/ld/testsuite/ld-arm/pie-bind-locally-a.s
new file mode 100644
index 0000000..76a2f67
--- /dev/null
+++ b/ld/testsuite/ld-arm/pie-bind-locally-a.s
@@ -0,0 +1,5 @@
+ .text
+ .align 2
+ .global _start
+_start:
+ .word _start(GOT)
diff --git a/ld/testsuite/ld-arm/pie-bind-locally-b.s b/ld/testsuite/ld-arm/pie-bind-locally-b.s
new file mode 100644
index 0000000..8e6ff4f
--- /dev/null
+++ b/ld/testsuite/ld-arm/pie-bind-locally-b.s
@@ -0,0 +1,6 @@
+ .section .data.rel,"aw",%progbits
+ .align 2
+ .type q, %object
+ .size q, 4
+q:
+ .word _start
diff --git a/ld/testsuite/ld-arm/pie-bind-locally.d b/ld/testsuite/ld-arm/pie-bind-locally.d
new file mode 100644
index 0000000..7ea031c
--- /dev/null
+++ b/ld/testsuite/ld-arm/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 '\.rel\.dyn' at offset .* contains 2 entries:
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_ARM_RELATIVE[ ].*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_ARM_RELATIVE[ ].*