hh_ind->dyn_relocs = NULL;
}
- if (ELIMINATE_COPY_RELOCS
- && eh_ind->root.type != bfd_link_hash_indirect
- && eh_dir->dynamic_adjusted)
+ if (eh_ind->root.type == bfd_link_hash_indirect)
{
- /* If called to transfer flags for a weakdef during processing
- of elf_adjust_dynamic_symbol, don't copy non_got_ref.
- We clear it ourselves for ELIMINATE_COPY_RELOCS. */
- if (eh_dir->versioned != versioned_hidden)
- eh_dir->ref_dynamic |= eh_ind->ref_dynamic;
- eh_dir->ref_regular |= eh_ind->ref_regular;
- eh_dir->ref_regular_nonweak |= eh_ind->ref_regular_nonweak;
- eh_dir->needs_plt |= eh_ind->needs_plt;
+ hh_dir->plabel |= hh_ind->plabel;
+ hh_dir->tls_type |= hh_ind->tls_type;
+ hh_ind->tls_type = GOT_UNKNOWN;
}
- else
- {
- if (eh_ind->root.type == bfd_link_hash_indirect)
- {
- hh_dir->plabel |= hh_ind->plabel;
- hh_dir->tls_type |= hh_ind->tls_type;
- hh_ind->tls_type = GOT_UNKNOWN;
- }
- _bfd_elf_link_hash_copy_indirect (info, eh_dir, eh_ind);
- }
+ _bfd_elf_link_hash_copy_indirect (info, eh_dir, eh_ind);
}
static int
/* Flag this symbol as having a non-got, non-plt reference
so that we generate copy relocs if it turns out to be
dynamic. */
- if (hh != NULL && !bfd_link_pic (info))
+ if (hh != NULL)
hh->eh.non_got_ref = 1;
/* If we are creating a shared library then we need to copy
else
eh->plt.offset = (bfd_vma) -1;
+ htab = hppa_link_hash_table (info);
+ if (htab == NULL)
+ return FALSE;
+
/* If this is a weak symbol, and there is a real definition, the
processor independent code will have arranged for us to see the
real definition first, and we can just use the same value. */
BFD_ASSERT (def->root.type == bfd_link_hash_defined);
eh->root.u.def.section = def->root.u.def.section;
eh->root.u.def.value = def->root.u.def.value;
- if (ELIMINATE_COPY_RELOCS)
- eh->non_got_ref = def->non_got_ref;
+ 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;
return TRUE;
}
determine the address it must put in the global offset table, so
both the dynamic object and the regular object will refer to the
same memory location for the variable. */
-
- htab = hppa_link_hash_table (info);
- if (htab == NULL)
- return FALSE;
-
- /* We must generate a COPY reloc to tell the dynamic linker to
- copy the initial value out of the dynamic object and into the
- runtime process image. */
if ((eh->root.u.def.section->flags & SEC_READONLY) != 0)
{
sec = htab->etab.sdynrelro;
}
if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0 && eh->size != 0)
{
+ /* We must generate a COPY reloc to tell the dynamic linker to
+ copy the initial value out of the dynamic object and into the
+ runtime process image. */
srel->size += sizeof (Elf32_External_Rela);
eh->needs_copy = 1;
}
bfd_link_pic (info),
&hh->eh))
{
- /* In a non-shared link, adjust_dynamic_symbols
+ /* In a non-shared link, adjust_dynamic_symbol
isn't called for symbols forced local. We
need to write out the plt entry here. */
if ((off & 1) != 0)