aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c71
1 files changed, 7 insertions, 64 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ef7a524..9d2d68a 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -722,9 +722,6 @@ elf_link_renumber_hash_table_dynsyms (struct elf_link_hash_entry *h,
{
size_t *count = (size_t *) data;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if (h->forced_local)
return TRUE;
@@ -744,9 +741,6 @@ elf_link_renumber_local_hash_table_dynsyms (struct elf_link_hash_entry *h,
{
size_t *count = (size_t *) data;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if (!h->forced_local)
return TRUE;
@@ -1812,16 +1806,13 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data)
{
struct elf_info_failed *eif = (struct elf_info_failed *) data;
- /* Ignore this if we won't export it. */
- if (!eif->info->export_dynamic && !h->dynamic)
- return TRUE;
-
/* Ignore indirect symbols. These are added by the versioning code. */
if (h->root.type == bfd_link_hash_indirect)
return TRUE;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ /* Ignore this if we won't export it. */
+ if (!eif->info->export_dynamic && !h->dynamic)
+ return TRUE;
if (h->dynindx == -1
&& (h->def_regular
@@ -1858,9 +1849,6 @@ _bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h,
Elf_Internal_Vernaux *a;
bfd_size_type amt;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* We only care about symbols defined in shared objects with version
information. */
if (!h->def_dynamic
@@ -1946,9 +1934,6 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
sinfo = (struct elf_info_failed *) data;
info = sinfo->info;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* Fix the symbol flags. */
eif.failed = FALSE;
eif.info = info;
@@ -2564,17 +2549,6 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
if (! is_elf_hash_table (eif->info->hash))
return FALSE;
- if (h->root.type == bfd_link_hash_warning)
- {
- h->got = elf_hash_table (eif->info)->init_got_offset;
- h->plt = elf_hash_table (eif->info)->init_plt_offset;
-
- /* When warning symbols are created, they **replace** the "real"
- entry in the hash table, thus we never get to see the real
- symbol in a hash traversal. So look at it now. */
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
-
/* Ignore indirect symbols. These are added by the versioning code. */
if (h->root.type == bfd_link_hash_indirect)
return TRUE;
@@ -2730,9 +2704,6 @@ _bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *h, void *data)
{
asection *sec;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& ((sec = h->root.u.def.section)->flags & SEC_MERGE)
@@ -3180,9 +3151,6 @@ elf_adjust_dynstr_offsets (struct elf_link_hash_entry *h, void *data)
{
struct elf_strtab_hash *dynstr = (struct elf_strtab_hash *) data;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if (h->dynindx != -1)
h->dynstr_index = _bfd_elf_strtab_offset (dynstr, h->dynstr_index);
return TRUE;
@@ -5175,9 +5143,6 @@ elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data)
unsigned long ha;
char *alc = NULL;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* Ignore indirect symbols. These are added by the versioning code. */
if (h->dynindx == -1)
return TRUE;
@@ -5246,9 +5211,6 @@ elf_collect_gnu_hash_codes (struct elf_link_hash_entry *h, void *data)
unsigned long ha;
char *alc = NULL;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* Ignore indirect symbols. These are added by the versioning code. */
if (h->dynindx == -1)
return TRUE;
@@ -5299,9 +5261,6 @@ elf_renumber_gnu_hash_syms (struct elf_link_hash_entry *h, void *data)
unsigned long int bucket;
unsigned long int val;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* Ignore indirect symbols. */
if (h->dynindx == -1)
return TRUE;
@@ -8605,8 +8564,9 @@ elf_link_check_versioned_symbol (struct bfd_link_info *info,
global symbols. */
static bfd_boolean
-elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
+elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
{
+ struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) bh;
struct elf_outext_info *eoinfo = (struct elf_outext_info *) data;
struct elf_final_link_info *finfo = eoinfo->finfo;
bfd_boolean strip;
@@ -10822,8 +10782,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
eoinfo.failed = FALSE;
eoinfo.finfo = &finfo;
eoinfo.localsyms = TRUE;
- elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
- &eoinfo);
+ bfd_hash_traverse (&info->hash->table, elf_link_output_extsym, &eoinfo);
if (eoinfo.failed)
return FALSE;
@@ -10932,8 +10891,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
eoinfo.failed = FALSE;
eoinfo.localsyms = FALSE;
eoinfo.finfo = &finfo;
- elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
- &eoinfo);
+ bfd_hash_traverse (&info->hash->table, elf_link_output_extsym, &eoinfo);
if (eoinfo.failed)
return FALSE;
@@ -11687,9 +11645,6 @@ struct elf_gc_sweep_symbol_info
static bfd_boolean
elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
{
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& !h->root.u.def.section->gc_mark
@@ -11801,9 +11756,6 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
static bfd_boolean
elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
{
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* Those that are not vtables. */
if (h->vtable == NULL || h->vtable->parent == NULL)
return TRUE;
@@ -11865,9 +11817,6 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
const struct elf_backend_data *bed;
unsigned int log_file_align;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
/* Take care of both those symbols that do not describe vtables as
well as those that are not loaded. */
if (h->vtable == NULL || h->vtable->parent == NULL)
@@ -11915,9 +11864,6 @@ bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->ref_dynamic
@@ -12190,9 +12136,6 @@ elf_gc_allocate_got_offsets (struct elf_link_hash_entry *h, void *arg)
bfd *obfd = gofarg->info->output_bfd;
const struct elf_backend_data *bed = get_elf_backend_data (obfd);
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
if (h->got.refcount > 0)
{
h->got.offset = gofarg->gotoff;