diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2015-07-27 11:48:48 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2015-07-27 11:48:48 +0100 |
commit | 32f573bcb3aaa1c9defcad79dbb5851fcc02ae2d (patch) | |
tree | af0f7a43f27080ec94da5a622c47f0b76fd02478 /ld | |
parent | b68a20d6675f1360ea4db50a9835c073675b9889 (diff) | |
download | binutils-32f573bcb3aaa1c9defcad79dbb5851fcc02ae2d.zip binutils-32f573bcb3aaa1c9defcad79dbb5851fcc02ae2d.tar.gz binutils-32f573bcb3aaa1c9defcad79dbb5851fcc02ae2d.tar.bz2 |
[AArch64] 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
* elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
ld/testsuite:
PR ld/18705
* ld-aarch64/protected-data.d: New.
* ld-aarch64/protected-data.s: New.
* ld-aarch64/aarch64-elf.exp: Add new test.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/aarch64-elf.exp | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/protected-data.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/protected-data.s | 18 |
4 files changed, 30 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 734fe69..db1302f 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,6 +1,13 @@ 2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com> PR ld/18705 + * ld-aarch64/protected-data.d: New. + * ld-aarch64/protected-data.s: New. + * ld-aarch64/aarch64-elf.exp: Add new test. + +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. diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index de3dcf7..ab2fa49 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -157,6 +157,7 @@ run_dump_test "gc-relocs-257" run_dump_test "pr17415" run_dump_test "tprel_g2_overflow" run_dump_test "tprel_add_lo12_overflow" +run_dump_test "protected-data" # ifunc tests run_dump_test "ifunc-1" diff --git a/ld/testsuite/ld-aarch64/protected-data.d b/ld/testsuite/ld-aarch64/protected-data.d new file mode 100644 index 0000000..df106dc --- /dev/null +++ b/ld/testsuite/ld-aarch64/protected-data.d @@ -0,0 +1,4 @@ +#ld: -shared +#readelf: -r -W +#... +.* R_AARCH64_GLOB_DAT .* var.* diff --git a/ld/testsuite/ld-aarch64/protected-data.s b/ld/testsuite/ld-aarch64/protected-data.s new file mode 100644 index 0000000..4878f05 --- /dev/null +++ b/ld/testsuite/ld-aarch64/protected-data.s @@ -0,0 +1,18 @@ + .data + .protected var + .global var + .align 2 + .type var, %object + .size var, 4 +var: + .word 1 + + .text + .align 2 + .global getaddr + .type getaddr, %function +getaddr: + adrp x0, :got:var + ldr x0, [x0, #:got_lo12:var] + ret + .size getaddr, .-getaddr |