+2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/26067
+ * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
+ * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
+ Updated.
+ * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
+ (elf_arc_link_hash_newfunc): Updated.
+ * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
+ (elf32_arm_link_hash_newfunc): Updated.
+ (elf32_arm_copy_indirect_symbol): Likewise.
+ (elf32_arm_check_relocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs_for_symbol): Likewise.
+ * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
+ (csky_elf_link_hash_newfunc): Updated.
+ (csky_allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (csky_elf_copy_indirect_symbol): Likewise.
+ * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
+ (hppa_link_hash_newfunc): Updated.
+ (elf32_hppa_copy_indirect_symbol): Likewise.
+ (elf32_hppa_hide_symbol): Likewise.
+ (elf32_hppa_adjust_dynamic_symbol): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (elf32_hppa_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_check_relocs): Likewise.
+ * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
+ (lm32_elf_link_hash_newfunc): Likewise.
+ (lm32_elf_link_hash_table_create): Updated.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (lm32_elf_copy_indirect_symbol): Likewise.
+ * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
+ (m32r_elf_link_hash_newfunc): Likewise.
+ (m32r_elf_link_hash_table_create): Updated.
+ (m32r_elf_copy_indirect_symbol): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
+ (metag_link_hash_newfunc): Updated.
+ (elf_metag_copy_indirect_symbol): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
+ dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (microblaze_elf_check_relocs): Likewise.
+ (microblaze_elf_copy_indirect_symbol): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
+ (nds32_elf_link_hash_newfunc): Updated.
+ (nds32_elf_copy_indirect_symbol): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (nds32_elf_check_relocs): Likewise.
+ * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (nios2_elf32_copy_indirect_symbol): Likewise.
+ (nios2_elf32_check_relocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
+ (or1k_elf_link_hash_newfunc): Updated.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (or1k_elf_copy_indirect_symbol): Likewise.
+ * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
+ (ppc_elf_link_hash_newfunc): Updated.
+ (ppc_elf_copy_indirect_symbol): Likewise.
+ (ppc_elf_check_relocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (ppc_elf_adjust_dynamic_symbol): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (ppc_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (elf_s390_copy_indirect_symbol): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (elf_s390_adjust_dynamic_symbol): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
+ (sh_elf_link_hash_newfunc): Updated.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (sh_elf_copy_indirect_symbol): Likewise.
+ (sh_elf_check_relocs): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
+ (elf32_tic6x_link_hash_newfunc): Likewise.
+ (elf32_tic6x_link_hash_table_create): Updated.
+ (readonly_dynrelocs): Likewise.
+ (elf32_tic6x_check_relocs): Likewise.
+ (elf32_tic6x_allocate_dynrelocs): Likewise.
+ * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
+ dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (tilepro_elf_copy_indirect_symbol): Likewise.
+ (tilepro_elf_check_relocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
+ (ppc64_elf_copy_indirect_symbol): Updated.
+ (ppc64_elf_check_relocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (ppc64_elf_adjust_dynamic_symbol): Likewise.
+ (dec_dynrel_count): Likewise.
+ (allocate_dynrelocs): Likewise.
+ (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (elf_s390_copy_indirect_symbol): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+ * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
+ dyn_relocs.
+ (elfNN_aarch64_link_hash_newfunc): Updated.
+ (elfNN_aarch64_copy_indirect_symbol): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (need_copy_relocation_p): Likewise.
+ (elfNN_aarch64_allocate_dynrelocs): Likewise.
+ (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
+ * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (riscv_elf_copy_indirect_symbol): Likewise.
+ (riscv_elf_check_relocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
+ dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
+ (_bfd_sparc_elf_check_relocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
+ (link_hash_newfunc): Updated.
+ (tilegx_elf_copy_indirect_symbol): Likewise.
+ (tilegx_elf_check_relocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (allocate_dynrelocs): Likewise.
+ * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
+ (readonly_dynrelocs): Likewise.
+ (_bfd_x86_elf_copy_indirect_symbol): Likewise.
+ * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
+
2020-06-01 Alan Modra <amodra@gmail.com>
* vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
/* Same, but tracks a procedure linkage table entry. */
union gotplt_union plt;
- /* Symbol size. */
+ /* Symbol size. NB: All fields starting from here are cleared by
+ _bfd_elf_link_hash_newfunc. */
bfd_size_type size;
+ /* Track dynamic relocs copied for this symbol. */
+ struct elf_dyn_relocs *dyn_relocs;
+
/* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */
unsigned int type : 8;
struct elf_dyn_relocs *p;
struct elf_link_hash_table *htab;
struct elf_s390_link_hash_entry *eh = (struct elf_s390_link_hash_entry*)h;
- struct elf_dyn_relocs **head = &eh->dyn_relocs;
+ struct elf_dyn_relocs **head = &h->dyn_relocs;
htab = elf_hash_table (info);
eh->ifunc_resolver_address = h->root.u.def.value;
{
struct elf_link_hash_entry root;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
struct got_entry *got_ents;
};
table, string));
if (ret != NULL)
{
- ret->dyn_relocs = NULL;
ret->got_ents = NULL;
}
{
struct elf_link_hash_entry root;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* ARM-specific PLT information. */
struct arm_plt_info plt;
table, string));
if (ret != NULL)
{
- ret->dyn_relocs = NULL;
ret->tls_type = GOT_UNKNOWN;
ret->tlsdesc_got = (bfd_vma) -1;
ret->plt.thumb_refcount = 0;
edir = (struct elf32_arm_link_hash_entry *) dir;
eind = (struct elf32_arm_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect)
/* If this is a global symbol, count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf32_arm_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
head = elf32_arm_get_local_dynreloc_list (abfd, r_symndx, isym);
{
struct elf_dyn_relocs *p;
- for (p = elf32_arm_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
h->root.u.def.value = th->root.u.def.value & ~1;
}
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
if (strcmp (p->sec->output_section->name, ".tls_vars") == 0)
*pp = p->next;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
int plt_refcount;
/* For sub jsri2bsr relocs count. */
int jsri2bsr_refcount;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
#define GOT_UNKNOWN 0
#define GOT_NORMAL 1
struct csky_elf_link_hash_entry *eh;
eh = (struct csky_elf_link_hash_entry *) ret;
- eh->dyn_relocs = NULL;
eh->plt_refcount = 0;
eh->jsri2bsr_refcount = 0;
eh->tls_type = GOT_NORMAL;
h->got.offset = (bfd_vma) -1;
eh = (struct csky_elf_link_hash_entry *) h;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
if (eh->jsri2bsr_refcount
&& h->root.type == bfd_link_hash_defined
- && eh->dyn_relocs != NULL)
- eh->dyn_relocs->count -= eh->jsri2bsr_refcount;
+ && h->dyn_relocs != NULL)
+ h->dyn_relocs->count -= eh->jsri2bsr_refcount;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *srelgot = htab->elf.srelgot;
srelgot->size += p->count * sizeof (Elf32_External_Rela);
{
struct elf_dyn_relocs *p;
- for (p = csky_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
edir = (struct csky_elf_link_hash_entry *) dir;
eind = (struct csky_elf_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
&& dir->got.refcount <= 0)
|| (ELF32_R_TYPE (rel->r_info)
== R_CKCORE_PCREL_JSR_IMM11BY2))
eh->jsri2bsr_refcount += 1;
- head = &eh->dyn_relocs;
+ head = &h->dyn_relocs;
}
else
{
symbol. */
struct elf32_hppa_stub_hash_entry *hsh_cache;
- /* Used to count relocations for delayed sizing of relocation
- sections. */
- struct elf_dyn_relocs *dyn_relocs;
-
ENUM_BITFIELD (_tls_type) tls_type : 8;
/* Set if this symbol is used by a plabel reloc. */
/* Initialize the local fields. */
hh = hppa_elf_hash_entry (entry);
hh->hsh_cache = NULL;
- hh->dyn_relocs = NULL;
hh->plabel = 0;
hh->tls_type = GOT_UNKNOWN;
}
hh_dir = hppa_elf_hash_entry (eh_dir);
hh_ind = hppa_elf_hash_entry (eh_ind);
- if (hh_ind->dyn_relocs != NULL
+ if (eh_ind->dyn_relocs != NULL
&& eh_ind->root.type == bfd_link_hash_indirect)
{
- if (hh_dir->dyn_relocs != NULL)
+ if (eh_dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **hdh_pp;
struct elf_dyn_relocs *hdh_p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (hdh_pp = &hh_ind->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
+ for (hdh_pp = &eh_ind->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
{
struct elf_dyn_relocs *hdh_q;
- for (hdh_q = hh_dir->dyn_relocs;
+ for (hdh_q = eh_dir->dyn_relocs;
hdh_q != NULL;
hdh_q = hdh_q->next)
if (hdh_q->sec == hdh_p->sec)
if (hdh_q == NULL)
hdh_pp = &hdh_p->next;
}
- *hdh_pp = hh_dir->dyn_relocs;
+ *hdh_pp = eh_dir->dyn_relocs;
}
- hh_dir->dyn_relocs = hh_ind->dyn_relocs;
- hh_ind->dyn_relocs = NULL;
+ eh_dir->dyn_relocs = eh_ind->dyn_relocs;
+ eh_ind->dyn_relocs = NULL;
}
if (eh_ind->root.type == bfd_link_hash_indirect)
relocations we need for this symbol. */
if (hh != NULL)
{
- hdh_head = &hh->dyn_relocs;
+ hdh_head = &hh->eh.dyn_relocs;
}
else
{
static asection *
readonly_dynrelocs (struct elf_link_hash_entry *eh)
{
- struct elf32_hppa_link_hash_entry *hh;
struct elf_dyn_relocs *hdh_p;
- hh = hppa_elf_hash_entry (eh);
- for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
+ for (hdh_p = eh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
{
asection *sec = hdh_p->sec->output_section;
/* Discard dyn_relocs when non-pic if we've decided that a
function symbol is local. */
if (!bfd_link_pic (info) && local)
- hppa_elf_hash_entry (eh)->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
/* If the symbol is used by a plabel, we must allocate a PLT slot.
The refcounts are not reliable when it has been hidden since
eh->root.u.def.value = def->root.u.def.value;
if (def->root.u.def.section == htab->etab.sdynbss
|| def->root.u.def.section == htab->etab.sdynrelro)
- hppa_elf_hash_entry (eh)->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
return TRUE;
}
}
/* We no longer want dyn_relocs. */
- hppa_elf_hash_entry (eh)->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
return _bfd_elf_adjust_dynamic_copy (info, eh, sec);
}
/* If no dynamic sections we can't have dynamic relocs. */
if (!htab->etab.dynamic_sections_created)
- hh->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
/* Discard relocs on undefined syms with non-default visibility. */
else if ((eh->root.type == bfd_link_hash_undefined
&& ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT)
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, eh))
- hh->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
- if (hh->dyn_relocs == NULL)
+ if (eh->dyn_relocs == NULL)
return TRUE;
/* If this is a -Bsymbolic shared link, then we need to discard all
{
struct elf_dyn_relocs **hdh_pp;
- for (hdh_pp = &hh->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
+ for (hdh_pp = &eh->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
{
hdh_p->count -= hdh_p->pc_count;
hdh_p->pc_count = 0;
}
#endif
- if (hh->dyn_relocs != NULL)
+ if (eh->dyn_relocs != NULL)
{
if (!ensure_undef_dynamic (info, eh))
return FALSE;
return FALSE;
if (eh->dynindx == -1)
- hh->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
}
else
- hh->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
}
/* Finally, allocate space. */
- for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
+ for (hdh_p = eh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
{
asection *sreloc = elf_section_data (hdh_p->sec)->sreloc;
sreloc->size += hdh_p->count * sizeof (Elf32_External_Rela);
if (bfd_link_pic (info)
? ((hh == NULL
- || hh->dyn_relocs != NULL)
+ || hh->eh.dyn_relocs != NULL)
&& ((hh != NULL && pc_dynrelocs (hh))
|| IS_ABSOLUTE_RELOC (r_type)))
: (hh != NULL
- && hh->dyn_relocs != NULL))
+ && hh->eh.dyn_relocs != NULL))
{
Elf_Internal_Rela outrel;
bfd_boolean skip;
relocations we need for this symbol. */
if (h != NULL)
{
- head = &eh->dyn_relocs;
+ head = &h->dyn_relocs;
}
else
{
static bfd_reloc_status_type lm32_elf_gprel_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-/* lm32 ELF linker hash entry. */
-
-struct elf_lm32_link_hash_entry
-{
- struct elf_link_hash_entry root;
-
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-};
-
/* lm32 ELF linker hash table. */
struct elf_lm32_link_hash_table
struct weak_symbol_list *next;
};
-/* Create an entry in an lm32 ELF linker hash table. */
-
-static struct bfd_hash_entry *
-lm32_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
-{
- struct elf_lm32_link_hash_entry *ret =
- (struct elf_lm32_link_hash_entry *) entry;
-
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (ret == NULL)
- ret = bfd_hash_allocate (table,
- sizeof (struct elf_lm32_link_hash_entry));
- if (ret == NULL)
- return NULL;
-
- /* Call the allocation method of the superclass. */
- ret = ((struct elf_lm32_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
- table, string));
- if (ret != NULL)
- {
- struct elf_lm32_link_hash_entry *eh;
-
- eh = (struct elf_lm32_link_hash_entry *) ret;
- eh->dyn_relocs = NULL;
- }
-
- return (struct bfd_hash_entry *) ret;
-}
-
/* Create an lm32 ELF linker hash table. */
static struct bfd_link_hash_table *
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- lm32_elf_link_hash_newfunc,
- sizeof (struct elf_lm32_link_hash_entry),
+ _bfd_elf_link_hash_newfunc,
+ sizeof (struct elf_link_hash_entry),
LM32_ELF_DATA))
{
free (ret);
readonly_dynrelocs (struct elf_link_hash_entry *h)
{
struct elf_dyn_relocs *p;
- struct elf_lm32_link_hash_entry *eh = (struct elf_lm32_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct bfd_link_info *info;
struct elf_lm32_link_hash_table *htab;
- struct elf_lm32_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
if (htab == NULL)
return FALSE;
- eh = (struct elf_lm32_link_hash_entry *) h;
-
if (htab->root.dynamic_sections_created
&& h->plt.refcount > 0)
{
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL;)
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf32_External_Rela);
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
- struct elf_lm32_link_hash_entry * edir;
- struct elf_lm32_link_hash_entry * eind;
-
- edir = (struct elf_lm32_link_hash_entry *) dir;
- eind = (struct elf_lm32_link_hash_entry *) ind;
-
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL;)
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
bfd_size_type count;
};
-/* m32r ELF linker hash entry. */
-
-struct elf_m32r_link_hash_entry
-{
- struct elf_link_hash_entry root;
-
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-};
-
/* m32r ELF linker hash table. */
struct elf_m32r_link_hash_table
(elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
== M32R_ELF_DATA ? ((struct elf_m32r_link_hash_table *) ((p)->hash)) : NULL)
-/* Create an entry in an m32r ELF linker hash table. */
-
-static struct bfd_hash_entry *
-m32r_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
-{
- struct elf_m32r_link_hash_entry *ret =
- (struct elf_m32r_link_hash_entry *) entry;
-
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (ret == NULL)
- ret = bfd_hash_allocate (table,
- sizeof (struct elf_m32r_link_hash_entry));
- if (ret == NULL)
- return NULL;
-
- /* Call the allocation method of the superclass. */
- ret = ((struct elf_m32r_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
- table, string));
- if (ret != NULL)
- {
- struct elf_m32r_link_hash_entry *eh;
-
- eh = (struct elf_m32r_link_hash_entry *) ret;
- eh->dyn_relocs = NULL;
- }
-
- return (struct bfd_hash_entry *) ret;
-}
-
/* Create an m32r ELF linker hash table. */
static struct bfd_link_hash_table *
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- m32r_elf_link_hash_newfunc,
- sizeof (struct elf_m32r_link_hash_entry),
+ _bfd_elf_link_hash_newfunc,
+ sizeof (struct elf_link_hash_entry),
M32R_ELF_DATA))
{
free (ret);
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
- struct elf_m32r_link_hash_entry * edir;
- struct elf_m32r_link_hash_entry * eind;
-
- edir = (struct elf_m32r_link_hash_entry *) dir;
- eind = (struct elf_m32r_link_hash_entry *) ind;
-
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL;)
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
readonly_dynrelocs (struct elf_link_hash_entry *h)
{
struct elf_dyn_relocs *p;
- struct elf_m32r_link_hash_entry *eh = (struct elf_m32r_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct bfd_link_info *info;
struct elf_m32r_link_hash_table *htab;
- struct elf_m32r_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
if (htab == NULL)
return FALSE;
- eh = (struct elf_m32r_link_hash_entry *) h;
-
if (htab->root.dynamic_sections_created
&& h->plt.refcount > 0)
{
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL;)
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf32_External_Rela);
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf_m32r_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too. */
symbol. */
struct elf_metag_stub_hash_entry *hsh_cache;
- /* Used to count relocations for delayed sizing of relocation
- sections. */
- struct elf_dyn_relocs *dyn_relocs;
-
enum
{
GOT_UNKNOWN = 0, GOT_NORMAL = 1, GOT_TLS_IE = 2, GOT_TLS_LDM = 4, GOT_TLS_GD = 8
/* Initialize the local fields. */
hh = (struct elf_metag_link_hash_entry *) entry;
hh->hsh_cache = NULL;
- hh->dyn_relocs = NULL;
hh->tls_type = GOT_UNKNOWN;
}
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (hh != NULL)
- hdh_head = &((struct elf_metag_link_hash_entry *) hh)->dyn_relocs;
+ hdh_head = &hh->eh.dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too. */
hh_dir = metag_elf_hash_entry (eh_dir);
hh_ind = metag_elf_hash_entry (eh_ind);
- if (hh_ind->dyn_relocs != NULL)
+ if (eh_ind->dyn_relocs != NULL)
{
- if (hh_dir->dyn_relocs != NULL)
+ if (eh_dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **hdh_pp;
struct elf_dyn_relocs *hdh_p;
/* Add reloc counts against the weak sym to the strong sym
list. Merge any entries against the same section. */
- for (hdh_pp = &hh_ind->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
+ for (hdh_pp = &eh_ind->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
{
struct elf_dyn_relocs *hdh_q;
- for (hdh_q = hh_dir->dyn_relocs; hdh_q != NULL;
+ for (hdh_q = eh_dir->dyn_relocs; hdh_q != NULL;
hdh_q = hdh_q->next)
if (hdh_q->sec == hdh_p->sec)
{
if (hdh_q == NULL)
hdh_pp = &hdh_p->next;
}
- *hdh_pp = hh_dir->dyn_relocs;
+ *hdh_pp = eh_dir->dyn_relocs;
}
- hh_dir->dyn_relocs = hh_ind->dyn_relocs;
- hh_ind->dyn_relocs = NULL;
+ eh_dir->dyn_relocs = eh_ind->dyn_relocs;
+ eh_ind->dyn_relocs = NULL;
}
if (eh_ind->root.type == bfd_link_hash_indirect
{
struct elf_dyn_relocs *p;
- for (p = metag_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct bfd_link_info *info;
struct elf_metag_link_hash_table *htab;
- struct elf_metag_link_hash_entry *hh;
struct elf_dyn_relocs *hdh_p;
if (eh->root.type == bfd_link_hash_indirect)
else
eh->got.offset = (bfd_vma) -1;
- hh = (struct elf_metag_link_hash_entry *) eh;
- if (hh->dyn_relocs == NULL)
+ if (eh->dyn_relocs == NULL)
return TRUE;
/* If this is a -Bsymbolic shared link, then we need to discard all
{
struct elf_dyn_relocs **hdh_pp;
- for (hdh_pp = &hh->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
+ for (hdh_pp = &eh->dyn_relocs; (hdh_p = *hdh_pp) != NULL; )
{
hdh_p->count -= hdh_p->pc_count;
hdh_p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (hh->dyn_relocs != NULL
+ if (eh->dyn_relocs != NULL
&& eh->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (eh->other) != STV_DEFAULT)
- hh->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- hh->dyn_relocs = NULL;
+ eh->dyn_relocs = NULL;
return TRUE;
keep: ;
}
/* Finally, allocate space. */
- for (hdh_p = hh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
+ for (hdh_p = eh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
{
asection *sreloc = elf_section_data (hdh_p->sec)->sreloc;
sreloc->size += hdh_p->count * sizeof (Elf32_External_Rela);
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* TLS Reference Types for the symbol; Updated by check_relocs */
#define TLS_GD 1 /* GD reloc. */
#define TLS_LD 2 /* LD reloc. */
struct elf32_mb_link_hash_entry *eh;
eh = (struct elf32_mb_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->tls_mask = 0;
}
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf32_mb_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
edir = (struct elf32_mb_link_hash_entry *) dir;
eind = (struct elf32_mb_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the weak sym to the strong sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
edir->tls_mask |= eind->tls_mask;
{
struct elf_dyn_relocs *p;
- for (p = elf32_mb_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
}
}
else if (UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
else
{
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf32_External_Rela);
{
struct elf_link_hash_entry root;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* For checking relocation type. */
enum elf_nds32_tls_type tls_type;
struct elf_nds32_link_hash_entry *eh;
eh = (struct elf_nds32_link_hash_entry *) ret;
- eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
eh->offset_to_gp = 0;
}
edir = (struct elf_nds32_link_hash_entry *) dir;
eind = (struct elf_nds32_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the weak sym to the strong sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL;)
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect)
{
struct elf_dyn_relocs *p;
- for (p = elf32_nds32_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
struct bfd_link_info *info;
struct elf_link_hash_table *ehtab;
struct elf_nds32_link_hash_table *htab;
- struct elf_nds32_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- eh = (struct elf_nds32_link_hash_entry *) h;
-
info = (struct bfd_link_info *) inf;
ehtab = elf_hash_table (info);
htab = nds32_elf_hash_table (info);
if (htab == NULL)
return FALSE;
- eh = (struct elf_nds32_link_hash_entry *) h;
-
if ((htab->root.dynamic_sections_created || h->type == STT_GNU_IFUNC)
&& h->plt.refcount > 0
&& !(bfd_link_pie (info) && h->def_regular))
else
h->got.offset = (bfd_vma)-1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL;)
{
p->count -= p->pc_count;
p->pc_count = 0;
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep:;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf32_External_Rela);
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf_nds32_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
asection *s;
symbol. */
struct elf32_nios2_stub_hash_entry *hsh_cache;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
#define GOT_UNKNOWN 0
#define GOT_NORMAL 1
#define GOT_TLS_GD 2
eh = (struct elf32_nios2_link_hash_entry *) entry;
eh->hsh_cache = NULL;
- eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
eh->got_types_used = 0;
}
edir = (struct elf32_nios2_link_hash_entry *) dir;
eind = (struct elf32_nios2_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf32_nios2_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf32_External_Rela);
{
struct elf_link_hash_entry root;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* Track type of TLS access. */
unsigned char tls_type;
};
struct elf_or1k_link_hash_entry *eh;
eh = (struct elf_or1k_link_hash_entry *) ret;
- eh->dyn_relocs = NULL;
eh->tls_type = TLS_UNKNOWN;
}
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf_or1k_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
readonly_dynrelocs (struct elf_link_hash_entry *h)
{
struct elf_dyn_relocs *sec_relocs;
- struct elf_or1k_link_hash_entry *eh = (struct elf_or1k_link_hash_entry *) h;
- for (sec_relocs = eh->dyn_relocs;
+ for (sec_relocs = h->dyn_relocs;
sec_relocs != NULL;
sec_relocs = sec_relocs->next)
{
{
struct bfd_link_info *info;
struct elf_or1k_link_hash_table *htab;
- struct elf_or1k_link_hash_entry *eh;
struct elf_dyn_relocs *sec_relocs;
if (h->root.type == bfd_link_hash_indirect)
if (htab == NULL)
return FALSE;
- eh = (struct elf_or1k_link_hash_entry *) h;
-
if (htab->root.dynamic_sections_created
&& h->plt.refcount > 0)
{
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (sec_relocs = *pp) != NULL;)
+ for (pp = &h->dyn_relocs; (sec_relocs = *pp) != NULL;)
{
sec_relocs->count -= sec_relocs->pc_count;
sec_relocs->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (sec_relocs = eh->dyn_relocs;
+ for (sec_relocs = h->dyn_relocs;
sec_relocs != NULL;
sec_relocs = sec_relocs->next)
{
edir = (struct elf_or1k_link_hash_entry *) dir;
eind = (struct elf_or1k_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL;)
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect)
from the beginning of the section. */
elf_linker_section_pointers_t *linker_section_pointer;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* Contexts in which symbol is used in the GOT.
Bits are or'd into the mask as the corresponding relocs are
encountered during check_relocs, with TLS_TLS being set when any
if (entry != NULL)
{
ppc_elf_hash_entry (entry)->linker_section_pointer = NULL;
- ppc_elf_hash_entry (entry)->dyn_relocs = NULL;
ppc_elf_hash_entry (entry)->tls_mask = 0;
ppc_elf_hash_entry (entry)->has_sda_refs = 0;
}
if (eind->elf.root.type != bfd_link_hash_indirect)
return;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
/* Copy over the GOT refcount entries that we may have already seen to
struct elf_dyn_relocs *p;
struct elf_dyn_relocs **rel_head;
- rel_head = &ppc_elf_hash_entry (h)->dyn_relocs;
+ rel_head = &h->dyn_relocs;
p = *rel_head;
if (p == NULL || p->sec != sec)
{
{
struct elf_dyn_relocs *p;
- for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct elf_dyn_relocs *p;
- for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
if (p->pc_count != 0)
return TRUE;
return FALSE;
/* Discard dyn_relocs when non-pic if we've decided that a
function symbol is local. */
if (!bfd_link_pic (info) && local)
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Clear procedure linkage table information for any symbol that
won't need a .plt entry. */
else if (!bfd_link_pic (info))
/* We are going to be defining the function symbol on the
plt stub, so no dyn_relocs needed when non-pic. */
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
h->protected_def = 0;
/* Function symbols can't have copy relocs. */
if (def->root.u.def.section == htab->elf.sdynbss
|| def->root.u.def.section == htab->elf.sdynrelro
|| def->root.u.def.section == htab->dynsbss)
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
return TRUE;
}
}
/* We no longer want dyn_relocs. */
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
\f
IFUNCs which are handled even in static executables. */
if (!htab->elf.dynamic_sections_created
&& h->type != STT_GNU_IFUNC)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Discard relocs on undefined symbols that must be local. */
else if (h->root.type == bfd_link_hash_undefined
&& ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Also discard relocs on undefined weak syms with non-default
visibility, or when dynamic_undefined_weak says so. */
else if (UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
if (strcmp (p->sec->output_section->name, ".tls_vars") == 0)
*pp = p->next;
}
}
- if (eh->dyn_relocs != NULL)
+ if (h->dyn_relocs != NULL)
{
/* Make sure this symbol is output as a dynamic symbol. */
if (!ensure_undef_dynamic (info, h))
return FALSE;
if (h->dynindx == -1)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
else
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
/* Allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
if (eh->elf.type == STT_GNU_IFUNC)
if (bfd_link_pic (info)
? ((h == NULL
- || ppc_elf_hash_entry (h)->dyn_relocs != NULL)
+ || h->dyn_relocs != NULL)
&& ((h != NULL && pc_dynrelocs (h))
|| must_be_dyn_reloc (info, r_type)))
: (h != NULL
- && ppc_elf_hash_entry (h)->dyn_relocs != NULL))
+ && h->dyn_relocs != NULL))
{
int skip;
bfd_byte *loc;
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* Number of GOTPLT references for a function. */
bfd_signed_vma gotplt_refcount;
struct elf_s390_link_hash_entry *eh;
eh = (struct elf_s390_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->gotplt_refcount = 0;
eh->tls_type = GOT_UNKNOWN;
eh->ifunc_resolver_address = 0;
edir = (struct elf_s390_link_hash_entry *) dir;
eind = (struct elf_s390_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
relocations we need for this symbol. */
if (h != NULL)
{
- head = &((struct elf_s390_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
}
else
{
{
struct elf_dyn_relocs *p;
- for (p = elf_s390_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
bfd_size_type pc_count = 0, count = 0;
struct elf_dyn_relocs **pp;
- struct elf_s390_link_hash_entry *eh;
struct elf_dyn_relocs *p;
- eh = (struct elf_s390_link_hash_entry *) h;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
pc_count += p->pc_count;
p->count -= p->pc_count;
{
struct bfd_link_info *info;
struct elf_s390_link_hash_table *htab;
- struct elf_s390_link_hash_entry *eh = (struct elf_s390_link_hash_entry *)h;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
{
struct elf_link_hash_entry root;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
bfd_signed_vma gotplt_refcount;
/* A local function descriptor, for FDPIC. The refcount counts
table, string));
if (ret != (struct elf_sh_link_hash_entry *) NULL)
{
- ret->dyn_relocs = NULL;
ret->gotplt_refcount = 0;
ret->funcdesc.refcount = 0;
ret->abs_funcdesc_refcount = 0;
{
struct elf_dyn_relocs *p;
- for (p = sh_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
htab->srelfuncdesc->size += sizeof (Elf32_External_Rela);
}
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
if (strcmp (p->sec->output_section->name, ".tls_vars") == 0)
*pp = p->next;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf32_External_Rela);
edir = (struct elf_sh_link_hash_entry *) dir;
eind = (struct elf_sh_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
edir->gotplt_refcount = eind->gotplt_refcount;
eind->gotplt_refcount = 0;
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct elf_sh_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too. */
#define elf32_tic6x_hash_table(p) \
((struct elf32_tic6x_link_hash_table *) ((p)->hash))
-/* TI C6X ELF linker hash entry. */
-
-struct elf32_tic6x_link_hash_entry
-{
- struct elf_link_hash_entry elf;
-
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-};
-
typedef enum
{
DELETE_EXIDX_ENTRY,
elf32_tic6x_tdata (abfd)->use_rela_p = use_rela_p;
}
-/* Create an entry in a C6X ELF linker hash table. */
-
-static struct bfd_hash_entry *
-elf32_tic6x_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
-{
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (entry == NULL)
- {
- entry = bfd_hash_allocate (table,
- sizeof (struct elf32_tic6x_link_hash_entry));
- if (entry == NULL)
- return entry;
- }
-
- /* Call the allocation method of the superclass. */
- entry = _bfd_elf_link_hash_newfunc (entry, table, string);
- if (entry != NULL)
- {
- struct elf32_tic6x_link_hash_entry *eh;
-
- eh = (struct elf32_tic6x_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
- }
-
- return entry;
-}
-
/* Create a C6X ELF linker hash table. */
static struct bfd_link_hash_table *
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
- elf32_tic6x_link_hash_newfunc,
- sizeof (struct elf32_tic6x_link_hash_entry),
+ _bfd_elf_link_hash_newfunc,
+ sizeof (struct elf_link_hash_entry),
TIC6X_ELF_DATA))
{
free (ret);
readonly_dynrelocs (struct elf_link_hash_entry *h)
{
struct elf_dyn_relocs *p;
- struct elf32_tic6x_link_hash_entry *eh
- = (struct elf32_tic6x_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
relocations we need for this symbol. */
if (h != NULL)
{
- head = &((struct elf32_tic6x_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
}
else
{
{
struct bfd_link_info *info;
struct elf32_tic6x_link_hash_table *htab;
- struct elf32_tic6x_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
return TRUE;
- eh = (struct elf32_tic6x_link_hash_entry *) h;
info = (struct bfd_link_info *) inf;
htab = elf32_tic6x_hash_table (info);
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* Discard relocs on undefined weak syms with non-default
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
}
}
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc;
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
#define GOT_UNKNOWN 0
#define GOT_NORMAL 1
#define GOT_TLS_GD 2
struct tilepro_elf_link_hash_entry *eh;
eh = (struct tilepro_elf_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
}
edir = (struct tilepro_elf_link_hash_entry *) dir;
eind = (struct tilepro_elf_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head =
- &((struct tilepro_elf_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
{
struct elf_dyn_relocs *p;
- for (p = tilepro_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct bfd_link_info *info;
struct tilepro_elf_link_hash_table *htab;
- struct tilepro_elf_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
else
h->got.offset = (bfd_vma) -1;
- eh = (struct tilepro_elf_link_hash_entry *) h;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * TILEPRO_ELF_RELA_BYTES;
struct ppc_link_hash_entry *next_dot_sym;
} u;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* Link between function code and descriptor symbols. */
struct ppc_link_hash_entry *oh;
return;
/* Copy over any dynamic relocs we may have on the indirect sym. */
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
/* Copy over got entries that we may have already seen to the
struct elf_dyn_relocs *p;
struct elf_dyn_relocs **head;
- head = &ppc_elf_hash_entry (h)->dyn_relocs;
+ head = &h->dyn_relocs;
p = *head;
if (p == NULL || p->sec != sec)
{
static asection *
readonly_dynrelocs (struct elf_link_hash_entry *h)
{
- struct ppc_link_hash_entry *eh = ppc_elf_hash_entry (h);
struct elf_dyn_relocs *p;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct elf_dyn_relocs *p;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = eh->elf.dyn_relocs; p != NULL; p = p->next)
if (p->pc_count != 0)
return TRUE;
return FALSE;
if (!bfd_link_pic (info)
&& h->type != STT_GNU_IFUNC
&& local)
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Clear procedure linkage table information for any symbol that
won't need a .plt entry. */
else if (!bfd_link_pic (info))
/* We are going to be defining the function symbol on the
plt stub, so no dyn_relocs needed when non-pic. */
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
/* ELFv2 function symbols can't have copy relocs. */
h->root.u.def.value = def->root.u.def.value;
if (def->root.u.def.section == htab->elf.sdynbss
|| def->root.u.def.section == htab->elf.sdynrelro)
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
return TRUE;
}
}
/* We no longer want dyn_relocs. */
- ppc_elf_hash_entry (h)->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
{
struct elf_dyn_relocs *p;
struct elf_dyn_relocs **pp;
- pp = &ppc_elf_hash_entry (h)->dyn_relocs;
+ pp = &h->dyn_relocs;
/* elf_gc_sweep may have already removed all dyn relocs associated
with local syms for a given section. Also, symbol flags are
IFUNCs which are handled even in static executables. */
if (!htab->elf.dynamic_sections_created
&& h->type != STT_GNU_IFUNC)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Discard relocs on undefined symbols that must be local. */
else if (h->root.type == bfd_link_hash_undefined
&& ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Also discard relocs on undefined weak syms with non-default
visibility, or when dynamic_undefined_weak says so. */
else if (UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
- if (eh->dyn_relocs != NULL)
+ if (h->dyn_relocs != NULL)
{
struct elf_dyn_relocs *p, **pp;
avoid writing weird assembly. */
if (SYMBOL_CALLS_LOCAL (info, h))
{
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
}
}
- if (eh->dyn_relocs != NULL)
+ if (h->dyn_relocs != NULL)
{
/* Ensure we catch all the cases where this symbol
should be made dynamic. */
/* But if that didn't work out, discard dynamic relocs. */
if (h->dynindx == -1)
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
else
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
if (eh->elf.type == STT_GNU_IFUNC)
if (bfd_link_pic (info)
? ((h == NULL
- || h->dyn_relocs != NULL)
+ || h->elf.dyn_relocs != NULL)
&& ((h != NULL && pc_dynrelocs (h))
|| must_be_dyn_reloc (info, r_type)))
: (h != NULL
- ? h->dyn_relocs != NULL
+ ? h->elf.dyn_relocs != NULL
: ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC))
{
bfd_boolean skip, relocate;
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* Number of GOTPLT references for a function. */
bfd_signed_vma gotplt_refcount;
struct elf_s390_link_hash_entry *eh;
eh = (struct elf_s390_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->gotplt_refcount = 0;
eh->tls_type = GOT_UNKNOWN;
eh->ifunc_resolver_address = 0;
edir = (struct elf_s390_link_hash_entry *) dir;
eind = (struct elf_s390_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
relocations we need for this symbol. */
if (h != NULL)
{
- head = &((struct elf_s390_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
}
else
{
{
struct elf_dyn_relocs *p;
- for (p = elf_s390_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
bfd_size_type pc_count = 0, count = 0;
struct elf_dyn_relocs **pp;
- struct elf_s390_link_hash_entry *eh;
struct elf_dyn_relocs *p;
- eh = (struct elf_s390_link_hash_entry *) h;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
pc_count += p->pc_count;
p->count -= p->pc_count;
{
struct bfd_link_info *info;
struct elf_s390_link_hash_table *htab;
- struct elf_s390_link_hash_entry *eh = (struct elf_s390_link_hash_entry *)h;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (Elf64_External_Rela);
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &eh->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
{
struct elf_link_hash_entry root;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
/* Since PLT entries have variable size, we need to record the
index into .got.plt instead of recomputing it from the PLT
offset. */
table, string));
if (ret != NULL)
{
- ret->dyn_relocs = NULL;
ret->got_type = GOT_UNKNOWN;
ret->plt_got_offset = (bfd_vma) - 1;
ret->stub_cache = NULL;
edir = (struct elf_aarch64_link_hash_entry *) dir;
eind = (struct elf_aarch64_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL;)
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect)
{
struct elf_dyn_relocs *p;
- for (p = elf_aarch64_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
struct elf_dyn_relocs *p;
asection *s;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = eh->root.dyn_relocs; p != NULL; p = p->next)
{
/* If there is any pc-relative reference, we need to keep copy relocation
to avoid propagating the relocation into runtime that current glibc
relocations we need for this symbol. */
if (h != NULL)
{
- struct elf_aarch64_link_hash_entry *eh;
- eh = (struct elf_aarch64_link_hash_entry *) h;
- head = &eh->dyn_relocs;
+ head = &h->dyn_relocs;
}
else
{
h->got.offset = (bfd_vma) - 1;
}
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL;)
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak)
+ if (h->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep:;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc;
{
struct bfd_link_info *info;
struct elf_aarch64_link_hash_table *htab;
- struct elf_aarch64_link_hash_entry *eh;
/* An example of a bfd_link_hash_indirect symbol is versioned
symbol. For example: __gxx_personality_v0(bfd_link_hash_indirect)
info = (struct bfd_link_info *) inf;
htab = elf_aarch64_hash_table (info);
- eh = (struct elf_aarch64_link_hash_entry *) h;
-
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
here if it is defined and referenced in a non-shared object. */
if (h->type == STT_GNU_IFUNC
&& h->def_regular)
return _bfd_elf_allocate_ifunc_dyn_relocs (info, h,
- &eh->dyn_relocs,
+ &h->dyn_relocs,
NULL,
htab->plt_entry_size,
htab->plt_header_size,
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
#define GOT_UNKNOWN 0
#define GOT_NORMAL 1
#define GOT_TLS_GD 2
struct riscv_elf_link_hash_entry *eh;
eh = (struct riscv_elf_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
}
edir = (struct riscv_elf_link_hash_entry *) dir;
eind = (struct riscv_elf_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct riscv_elf_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
{
struct elf_dyn_relocs *p;
- for (p = riscv_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct bfd_link_info *info;
struct riscv_elf_link_hash_table *htab;
- struct riscv_elf_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
else
h->got.offset = (bfd_vma) -1;
- eh = (struct riscv_elf_link_hash_entry *) h;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * sizeof (ElfNN_External_Rela);
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
#define GOT_UNKNOWN 0
#define GOT_NORMAL 1
#define GOT_TLS_GD 2
struct _bfd_sparc_elf_link_hash_entry *eh;
eh = (struct _bfd_sparc_elf_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
eh->has_got_reloc = 0;
eh->has_non_got_reloc = 0;
edir = (struct _bfd_sparc_elf_link_hash_entry *) dir;
eind = (struct _bfd_sparc_elf_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect && dir->got.refcount <= 0)
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head = &((struct _bfd_sparc_elf_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
{
struct elf_dyn_relocs *p;
- for (p = _bfd_sparc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
if (strcmp (p->sec->output_section->name, ".tls_vars") == 0)
*pp = p->next;
/* Also discard relocs on undefined weak syms with non-default
visibility or in PIE. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
/* An undefined weak symbol is never
can branch to 0 without PLT. */
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL;)
if (p->pc_count == 0)
*pp = p->next;
else
pp = &p->next;
}
- if (eh->dyn_relocs != NULL)
+ if (h->dyn_relocs != NULL)
{
/* Make sure undefined weak symbols are output
as dynamic symbols in PIEs for dynamic non-GOT
}
}
else
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
/* Make sure undefined weak symbols are output as a dynamic
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * SPARC_ELF_RELA_BYTES (htab);
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
#define GOT_UNKNOWN 0
#define GOT_NORMAL 1
#define GOT_TLS_GD 2
struct tilegx_elf_link_hash_entry *eh;
eh = (struct tilegx_elf_link_hash_entry *) entry;
- eh->dyn_relocs = NULL;
eh->tls_type = GOT_UNKNOWN;
}
edir = (struct tilegx_elf_link_hash_entry *) dir;
eind = (struct tilegx_elf_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- head =
- &((struct tilegx_elf_link_hash_entry *) h)->dyn_relocs;
+ head = &h->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
{
struct elf_dyn_relocs *p;
- for (p = tilegx_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
{
struct bfd_link_info *info;
struct tilegx_elf_link_hash_table *htab;
- struct tilegx_elf_link_hash_entry *eh;
struct elf_dyn_relocs *p;
if (h->root.type == bfd_link_hash_indirect)
else
h->got.offset = (bfd_vma) -1;
- eh = (struct tilegx_elf_link_hash_entry *) h;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
sreloc->size += p->count * TILEGX_ELF_RELA_BYTES (htab);
if (h->type == STT_GNU_IFUNC
&& h->def_regular)
{
- if (_bfd_elf_allocate_ifunc_dyn_relocs (info, h, &eh->dyn_relocs,
+ if (_bfd_elf_allocate_ifunc_dyn_relocs (info, h, &h->dyn_relocs,
&htab->readonly_dynrelocs_against_ifunc,
plt_entry_size,
(htab->plt.has_plt0
else
h->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (h->dyn_relocs == NULL)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
p->count -= p->pc_count;
p->pc_count = 0;
if (htab->target_os == is_vxworks)
{
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
if (strcmp (p->sec->output_section->name, ".tls_vars") == 0)
*pp = p->next;
/* Also discard relocs on undefined weak syms with non-default
visibility or in PIE. */
- if (eh->dyn_relocs != NULL)
+ if (h->dyn_relocs != NULL)
{
if (h->root.type == bfd_link_hash_undefweak)
{
that we can branch to 0 without PLT. */
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
if (p->pc_count == 0)
*pp = p->next;
else
/* Make sure undefined weak symbols are output
as dynamic symbols in PIEs for dynamic non-GOT
non-PLT reloations. */
- if (eh->dyn_relocs != NULL
+ if (h->dyn_relocs != NULL
&& !bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
else
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
}
else if (h->dynindx == -1
&& !h->forced_local
which turn out to need copy relocs. */
struct elf_dyn_relocs **pp;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
if (p->pc_count != 0)
*pp = p->next;
goto keep;
}
- eh->dyn_relocs = NULL;
+ h->dyn_relocs = NULL;
keep: ;
}
/* Finally, allocate space. */
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc;
{
struct elf_dyn_relocs *p;
- for (p = elf_x86_hash_entry (h)->dyn_relocs; p != NULL; p = p->next)
+ for (p = h->dyn_relocs; p != NULL; p = p->next)
{
asection *s = p->sec->output_section;
edir = (struct elf_x86_link_hash_entry *) dir;
eind = (struct elf_x86_link_hash_entry *) ind;
- if (eind->dyn_relocs != NULL)
+ if (ind->dyn_relocs != NULL)
{
- if (edir->dyn_relocs != NULL)
+ if (dir->dyn_relocs != NULL)
{
struct elf_dyn_relocs **pp;
struct elf_dyn_relocs *p;
/* Add reloc counts against the indirect sym to the direct sym
list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &ind->dyn_relocs; (p = *pp) != NULL; )
{
struct elf_dyn_relocs *q;
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ for (q = dir->dyn_relocs; q != NULL; q = q->next)
if (q->sec == p->sec)
{
q->pc_count += p->pc_count;
if (q == NULL)
pp = &p->next;
}
- *pp = edir->dyn_relocs;
+ *pp = dir->dyn_relocs;
}
- edir->dyn_relocs = eind->dyn_relocs;
- eind->dyn_relocs = NULL;
+ dir->dyn_relocs = ind->dyn_relocs;
+ ind->dyn_relocs = NULL;
}
if (ind->root.type == bfd_link_hash_indirect
struct elf_dyn_relocs **pp;
eh = (struct elf_x86_link_hash_entry *) h;
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ for (pp = &h->dyn_relocs; (p = *pp) != NULL; )
{
pc_count += p->pc_count;
p->count -= p->pc_count;
{
struct elf_link_hash_entry elf;
- /* Track dynamic relocs copied for this symbol. */
- struct elf_dyn_relocs *dyn_relocs;
-
unsigned char tls_type;
/* Bit 0: Symbol has no GOT nor PLT relocations.