aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-06 15:25:07 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-06 15:29:32 -0700
commit98b273dc13b1e45db8c66821efc9e514884f3c25 (patch)
tree92329e76f47f0ae15386ce2669f43617c2666a9b /bfd/elf32-i386.c
parentb3b7c423883ad8d8b81f166ad2d2d4b637086bc0 (diff)
downloadgdb-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/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 5fbcd60..f752de6 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1619,7 +1619,7 @@ elf_i386_check_relocs (bfd *abfd,
if (h == NULL)
continue;
- eh->has_got_reloc = 1;
+ eh->zero_undefweak &= 0x2;
h->needs_plt = 1;
h->plt.refcount += 1;
break;
@@ -1746,7 +1746,7 @@ elf_i386_check_relocs (bfd *abfd,
if (r_type != R_386_TLS_IE)
{
if (eh != NULL)
- eh->has_got_reloc = 1;
+ eh->zero_undefweak &= 0x2;
break;
}
/* Fall through */
@@ -1754,7 +1754,7 @@ elf_i386_check_relocs (bfd *abfd,
case R_386_TLS_LE_32:
case R_386_TLS_LE:
if (eh != NULL)
- eh->has_got_reloc = 1;
+ eh->zero_undefweak &= 0x2;
if (bfd_link_executable (info))
break;
info->flags |= DF_STATIC_TLS;
@@ -1763,7 +1763,7 @@ elf_i386_check_relocs (bfd *abfd,
case R_386_32:
case R_386_PC32:
if (eh != NULL && (sec->flags & SEC_CODE) != 0)
- eh->has_non_got_reloc = 1;
+ eh->zero_undefweak |= 0x2;
do_relocation:
/* We are called after all symbols have been resolved. Only
relocation against STT_GNU_IFUNC symbol must go through