aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2015-07-27 11:45:27 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2015-07-27 11:45:27 +0100
commitb68a20d6675f1360ea4db50a9835c073675b9889 (patch)
tree04c4b525cdd838ddd3bdd0cf0bfad8cb1157aad1 /ld
parent0c096ed760273eb364d2e4e6def21f688ceff525 (diff)
downloadgdb-b68a20d6675f1360ea4db50a9835c073675b9889.zip
gdb-b68a20d6675f1360ea4db50a9835c073675b9889.tar.gz
gdb-b68a20d6675f1360ea4db50a9835c073675b9889.tar.bz2
[ARM] Fix extern protected data handling
Emit *GLOB_DAT instead of *RELATIVE relocs for protected data in shared objects. This is needed for the fix of glibc bug 17711: https://sourceware.org/bugzilla/show_bug.cgi?id=17711 bfd: PR ld/18705 * elf32-arm.c (elf_backend_extern_protected_data): Define. ld/testsuite: PR ld/18705 * ld-arm/protected-data.d: New. * ld-arm/protected-data.s: New. * ld-arm/arm-elf.exp: Add new test.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp1
-rw-r--r--ld/testsuite/ld-arm/protected-data.d4
-rw-r--r--ld/testsuite/ld-arm/protected-data.s29
4 files changed, 41 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index de0ad1b..734fe69 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ PR ld/18705
+ * ld-arm/protected-data.d: New.
+ * ld-arm/protected-data.s: New.
+ * ld-arm/arm-elf.exp: Add new test.
+
2015-07-26 H.J. Lu <hongjiu.lu@intel.com>
PR ld/18718
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 28b41ca..882f5cb 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -904,3 +904,4 @@ if { ![istarget "arm*-*-nacl*"] } {
}
run_dump_test "unresolved-2"
run_dump_test "gc-hidden-1"
+run_dump_test "protected-data"
diff --git a/ld/testsuite/ld-arm/protected-data.d b/ld/testsuite/ld-arm/protected-data.d
new file mode 100644
index 0000000..51c51c6
--- /dev/null
+++ b/ld/testsuite/ld-arm/protected-data.d
@@ -0,0 +1,4 @@
+#ld: -shared
+#readelf: -r -W
+#...
+.* R_ARM_GLOB_DAT .* var.*
diff --git a/ld/testsuite/ld-arm/protected-data.s b/ld/testsuite/ld-arm/protected-data.s
new file mode 100644
index 0000000..8c8072d
--- /dev/null
+++ b/ld/testsuite/ld-arm/protected-data.s
@@ -0,0 +1,29 @@
+ .syntax unified
+
+ .data
+ .protected var
+ .global var
+ .align 2
+ .type var, %object
+ .size var, 4
+var:
+ .word 1
+
+ .text
+ .align 2
+ .global getaddr
+ .thumb
+ .thumb_func
+ .type getaddr, %function
+getaddr:
+ ldr r3, 2f
+ ldr r2, 2f+4
+1:
+ add r3, pc
+ ldr r0, [r3, r2]
+ bx lr
+ .align 2
+2:
+ .word _GLOBAL_OFFSET_TABLE_-(1b+4)
+ .word var(GOT)
+ .size getaddr, .-getaddr