mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 20:14:06 +08:00
[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.
This commit is contained in:
parent
0c096ed760
commit
b68a20d667
@ -1,3 +1,8 @@
|
||||
2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||
|
||||
PR ld/18705
|
||||
* elf32-arm.c (elf_backend_extern_protected_data): Define.
|
||||
|
||||
2015-07-25 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/18718
|
||||
|
@ -16236,6 +16236,7 @@ elf32_arm_get_synthetic_symtab (bfd *abfd,
|
||||
#define elf_backend_default_use_rela_p 0
|
||||
|
||||
#define elf_backend_got_header_size 12
|
||||
#define elf_backend_extern_protected_data 1
|
||||
|
||||
#undef elf_backend_obj_attrs_vendor
|
||||
#define elf_backend_obj_attrs_vendor "aeabi"
|
||||
|
@ -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
|
||||
|
@ -904,3 +904,4 @@ if { ![istarget "arm*-*-nacl*"] } {
|
||||
}
|
||||
run_dump_test "unresolved-2"
|
||||
run_dump_test "gc-hidden-1"
|
||||
run_dump_test "protected-data"
|
||||
|
4
ld/testsuite/ld-arm/protected-data.d
Normal file
4
ld/testsuite/ld-arm/protected-data.d
Normal file
@ -0,0 +1,4 @@
|
||||
#ld: -shared
|
||||
#readelf: -r -W
|
||||
#...
|
||||
.* R_ARM_GLOB_DAT .* var.*
|
29
ld/testsuite/ld-arm/protected-data.s
Normal file
29
ld/testsuite/ld-arm/protected-data.s
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user