mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 10:34:21 +08:00
[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.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
|
PR ld/18705
|
||||||
|
* elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
|
||||||
|
|
||||||
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
PR ld/18705
|
PR ld/18705
|
||||||
|
@ -8655,6 +8655,7 @@ const struct elf_size_info elfNN_aarch64_size_info =
|
|||||||
#define elf_backend_rela_normal 1
|
#define elf_backend_rela_normal 1
|
||||||
#define elf_backend_got_header_size (GOT_ENTRY_SIZE * 3)
|
#define elf_backend_got_header_size (GOT_ENTRY_SIZE * 3)
|
||||||
#define elf_backend_default_execstack 0
|
#define elf_backend_default_execstack 0
|
||||||
|
#define elf_backend_extern_protected_data 1
|
||||||
|
|
||||||
#undef elf_backend_obj_attrs_section
|
#undef elf_backend_obj_attrs_section
|
||||||
#define elf_backend_obj_attrs_section ".ARM.attributes"
|
#define elf_backend_obj_attrs_section ".ARM.attributes"
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
PR ld/18705
|
PR ld/18705
|
||||||
|
@ -157,6 +157,7 @@ run_dump_test "gc-relocs-257"
|
|||||||
run_dump_test "pr17415"
|
run_dump_test "pr17415"
|
||||||
run_dump_test "tprel_g2_overflow"
|
run_dump_test "tprel_g2_overflow"
|
||||||
run_dump_test "tprel_add_lo12_overflow"
|
run_dump_test "tprel_add_lo12_overflow"
|
||||||
|
run_dump_test "protected-data"
|
||||||
|
|
||||||
# ifunc tests
|
# ifunc tests
|
||||||
run_dump_test "ifunc-1"
|
run_dump_test "ifunc-1"
|
||||||
|
4
ld/testsuite/ld-aarch64/protected-data.d
Normal file
4
ld/testsuite/ld-aarch64/protected-data.d
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#ld: -shared
|
||||||
|
#readelf: -r -W
|
||||||
|
#...
|
||||||
|
.* R_AARCH64_GLOB_DAT .* var.*
|
18
ld/testsuite/ld-aarch64/protected-data.s
Normal file
18
ld/testsuite/ld-aarch64/protected-data.s
Normal file
@ -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
|
Reference in New Issue
Block a user