aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-09 07:29:15 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-09 07:29:29 -0700
commitc5bce5c69721af8dae5c607e085e545cdba33ab1 (patch)
tree2132bf4a5c083b2db7c0f54ee6aec6bb97068c0e /bfd/elfxx-x86.c
parent8fbf0ba18c8a63bd4974086f6709b2bf050b0b0b (diff)
downloadgdb-c5bce5c69721af8dae5c607e085e545cdba33ab1.zip
gdb-c5bce5c69721af8dae5c607e085e545cdba33ab1.tar.gz
gdb-c5bce5c69721af8dae5c607e085e545cdba33ab1.tar.bz2
x86: Update UNDEFINED_WEAK_RESOLVED_TO_ZERO
Since the only information which SYMBOL_REFERENCES_LOCAL_P doesn't check is relocations, UNDEFINED_WEAK_RESOLVED_TO_ZERO only needs to check for relocations with SYMBOL_REFERENCES_LOCAL_P. * elf32-i386.c (elf_i386_relocate_section): Update usage of UNDEFINED_WEAK_RESOLVED_TO_ZERO. (elf_i386_finish_dynamic_symbol): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. (elf_x86_64_finish_dynamic_symbol): Likewise. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise. (_bfd_x86_elf_fixup_symbol): Likewise.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r--bfd/elfxx-x86.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 20b07f0..c41dbef 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -107,10 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h,
plt_entry_size = htab->plt.plt_entry_size;
- resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
- bed->target_id,
- eh->has_got_reloc,
- eh);
+ resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
/* Clear the reference count of function pointer relocations if
symbol isn't a normal function. */
@@ -1446,19 +1443,12 @@ bfd_boolean
_bfd_x86_elf_fixup_symbol (struct bfd_link_info *info,
struct elf_link_hash_entry *h)
{
- if (h->dynindx != -1)
+ if (h->dynindx != -1
+ && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, elf_x86_hash_entry (h)))
{
- const struct elf_backend_data *bed
- = get_elf_backend_data (info->output_bfd);
- if (UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
- bed->target_id,
- elf_x86_hash_entry (h)->has_got_reloc,
- elf_x86_hash_entry (h)))
- {
- h->dynindx = -1;
- _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
- h->dynstr_index);
- }
+ h->dynindx = -1;
+ _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
+ h->dynstr_index);
}
return TRUE;
}