diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-10-06 15:25:07 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-10-06 15:29:32 -0700 |
commit | 98b273dc13b1e45db8c66821efc9e514884f3c25 (patch) | |
tree | 92329e76f47f0ae15386ce2669f43617c2666a9b /bfd/elfxx-x86.h | |
parent | b3b7c423883ad8d8b81f166ad2d2d4b637086bc0 (diff) | |
download | gdb-98b273dc13b1e45db8c66821efc9e514884f3c25.zip gdb-98b273dc13b1e45db8c66821efc9e514884f3c25.tar.gz gdb-98b273dc13b1e45db8c66821efc9e514884f3c25.tar.bz2 |
x86: Use zero_undefweak in elf_x86_link_hash_entry
Replace has_got_reloc and has_non_got_reloc in elf_x86_link_hash_entry
with zero_undefweak:
Bit 0: Symbol has no GOT nor PLT relocations.
Bit 1: Symbol has non-GOT/non-PLT relocations in text sections.
zero_undefweak is initialized to 1 and undefined weak symbol should be
resolved to 0 if zero_undefweak > 0.
* elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
and has_non_got_reloc with zero_undefweak.
* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
* elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
zero_undefweak to 1.
(_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
has_non_got_reloc with zero_undefweak.
* elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
has_got_reloc and has_non_got_reloc with zero_undefweak.
(elf_x86_link_hash_entry): Likewise.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r-- | bfd/elfxx-x86.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index 5dc21b0..8e78b7e 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -60,8 +60,7 @@ ((EH)->elf.root.type == bfd_link_hash_undefweak \ && (SYMBOL_REFERENCES_LOCAL_P ((INFO), &(EH)->elf) \ || (bfd_link_executable (INFO) \ - && (!(EH)->has_got_reloc \ - || (EH)->has_non_got_reloc)))) + && (EH)->zero_undefweak > 0))) /* Should copy relocation be generated for a symbol. Don't generate copy relocation against a protected symbol defined in a shared @@ -236,11 +235,11 @@ struct elf_x86_link_hash_entry unsigned char tls_type; - /* TRUE if symbol has GOT or PLT relocations. */ - unsigned int has_got_reloc : 1; - - /* TRUE if symbol has non-GOT/non-PLT relocations in text sections. */ - unsigned int has_non_got_reloc : 1; + /* Bit 0: Symbol has no GOT nor PLT relocations. + Bit 1: Symbol has non-GOT/non-PLT relocations in text sections. + zero_undefweak is initialized to 1 and undefined weak symbol + should be resolved to 0 if zero_undefweak > 0. */ + unsigned int zero_undefweak : 2; /* Don't call finish_dynamic_symbol on this symbol. */ unsigned int no_finish_dynamic_symbol : 1; |