diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-03-05 06:34:39 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-03-05 06:34:53 -0800 |
commit | ca3fe95e469b9daec153caa2c90665f5daaec2b5 (patch) | |
tree | bb39e2b029b05c48bb5898ad2b0e79d91316e13f /bfd/elf32-i386.c | |
parent | a26de52c63a8b4da94e8e1c8b308b938b2434808 (diff) | |
download | gdb-ca3fe95e469b9daec153caa2c90665f5daaec2b5.zip gdb-ca3fe95e469b9daec153caa2c90665f5daaec2b5.tar.gz gdb-ca3fe95e469b9daec153caa2c90665f5daaec2b5.tar.bz2 |
Add extern_protected_data and set it for x86
With copy relocation, address of protected data defined in the shared
library may be external. This patch adds extern_protected_data and
changes _bfd_elf_symbol_refs_local_p to return false for protected data
if extern_protected_data is true.
bfd/
PR ld/pr15228
PR ld/pr17709
* elf-bfd.h (elf_backend_data): Add extern_protected_data.
* elf32-i386.c (elf_backend_extern_protected_data): New.
Defined to 1.
* elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
* elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
copy relocs against protected symbols if extern_protected_data
is true.
(_bfd_elf_symbol_refs_local_p): Don't return true on protected
non-function symbols if extern_protected_data is true.
* elfxx-target.h (elf_backend_extern_protected_data): New.
Default to 0.
(elfNN_bed): Initialize extern_protected_data with
elf_backend_extern_protected_data.
ld/testsuite/
PR ld/pr15228
PR ld/pr17709
* ld-i386/i386.exp (i386tests): Add a test for PR ld/17709.
* ld-i386/pr17709-nacl.rd: New file.
* ld-i386/pr17709.rd: Likewise.
* ld-i386/pr17709a.s: Likewise.
* ld-i386/pr17709b.s: Likewise.
* ld-i386/protected3.d: Updated.
* ld-i386/protected3.s: Likewise.
* ld-x86-64/pr17709-nacl.rd: New file.
* ld-x86-64/pr17709.rd: Likewise.
* ld-x86-64/pr17709a.s: Likewise.
* ld-x86-64/pr17709b.s: Likewise.
* ld-x86-64/protected3.d: Updated.
* ld-x86-64/protected3.s: Likewise.
* ld-x86-64/x86-64.exp (x86_64tests): Add a test for PR ld/17709.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 3f16fc1..52f4d33 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -5292,6 +5292,7 @@ elf_i386_add_symbol_hook (bfd * abfd, #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 12 #define elf_backend_plt_alignment 4 +#define elf_backend_extern_protected_data 1 /* Support RELA for objdump of prelink objects. */ #define elf_info_to_howto elf_i386_info_to_howto_rel |