x86: Resolve local undefined weak symbol to 0
Local undefined weak symbol should always be resolved to 0. * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve local undefined weak symbol to 0. * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
This commit is contained in:
parent
d4c6ce5b01
commit
84da4cf89e
|
@ -3,6 +3,12 @@
|
||||||
* elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
|
* elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
|
||||||
abs to fix a truncation warning.
|
abs to fix a truncation warning.
|
||||||
|
|
||||||
|
2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
|
||||||
|
local undefined weak symbol to 0.
|
||||||
|
* elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
|
||||||
|
|
||||||
2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
|
2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
|
* elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
|
||||||
|
|
|
@ -945,14 +945,16 @@ static const struct elf_i386_backend_data elf_i386_arch_bed =
|
||||||
it isn't dynamic and
|
it isn't dynamic and
|
||||||
1. Has non-GOT/non-PLT relocations in text section. Or
|
1. Has non-GOT/non-PLT relocations in text section. Or
|
||||||
2. Has no GOT/PLT relocation.
|
2. Has no GOT/PLT relocation.
|
||||||
|
Local undefined weak symbol is always resolved to 0.
|
||||||
*/
|
*/
|
||||||
#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, GOT_RELOC, EH) \
|
#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, GOT_RELOC, EH) \
|
||||||
((EH)->elf.root.type == bfd_link_hash_undefweak \
|
((EH)->elf.root.type == bfd_link_hash_undefweak \
|
||||||
&& bfd_link_executable (INFO) \
|
&& ((EH)->elf.forced_local \
|
||||||
|
|| (bfd_link_executable (INFO) \
|
||||||
&& (elf_i386_hash_table (INFO)->interp == NULL \
|
&& (elf_i386_hash_table (INFO)->interp == NULL \
|
||||||
|| !(GOT_RELOC) \
|
|| !(GOT_RELOC) \
|
||||||
|| (EH)->has_non_got_reloc \
|
|| (EH)->has_non_got_reloc \
|
||||||
|| !(INFO)->dynamic_undefined_weak))
|
|| !(INFO)->dynamic_undefined_weak))))
|
||||||
|
|
||||||
/* i386 ELF linker hash entry. */
|
/* i386 ELF linker hash entry. */
|
||||||
|
|
||||||
|
|
|
@ -1050,14 +1050,16 @@ static const struct elf_x86_64_backend_data elf_x86_64_arch_bed =
|
||||||
it isn't dynamic and
|
it isn't dynamic and
|
||||||
1. Has non-GOT/non-PLT relocations in text section. Or
|
1. Has non-GOT/non-PLT relocations in text section. Or
|
||||||
2. Has no GOT/PLT relocation.
|
2. Has no GOT/PLT relocation.
|
||||||
|
Local undefined weak symbol is always resolved to 0.
|
||||||
*/
|
*/
|
||||||
#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, GOT_RELOC, EH) \
|
#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, GOT_RELOC, EH) \
|
||||||
((EH)->elf.root.type == bfd_link_hash_undefweak \
|
((EH)->elf.root.type == bfd_link_hash_undefweak \
|
||||||
&& bfd_link_executable (INFO) \
|
&& ((EH)->elf.forced_local \
|
||||||
|
|| (bfd_link_executable (INFO) \
|
||||||
&& (elf_x86_64_hash_table (INFO)->interp == NULL \
|
&& (elf_x86_64_hash_table (INFO)->interp == NULL \
|
||||||
|| !(GOT_RELOC) \
|
|| !(GOT_RELOC) \
|
||||||
|| (EH)->has_non_got_reloc \
|
|| (EH)->has_non_got_reloc \
|
||||||
|| !(INFO)->dynamic_undefined_weak))
|
|| !(INFO)->dynamic_undefined_weak))))
|
||||||
|
|
||||||
/* x86-64 ELF linker hash entry. */
|
/* x86-64 ELF linker hash entry. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue