if we are creating a shared library and the symbol is
still undefined, we create a dynamic relocation to fill
in the correct value. */
- if (bfd_link_pic (info) && eh->root.type == bfd_link_hash_undefined)
+ if (eh->root.type == bfd_link_hash_undefined
+ || eh->root.type == bfd_link_hash_undefweak)
value = 0;
else
- value = (eh->root.u.def.value + eh->root.u.def.section->vma);
+ {
+ BFD_ASSERT (eh->root.type == bfd_link_hash_defined
+ || eh->root.type == bfd_link_hash_defweak);
+
+ value = eh->root.u.def.value + eh->root.u.def.section->vma;
+ }
/* Fill in the entry in the procedure linkage table.
{
bfd_vma value;
+ BFD_ASSERT (eh->root.type == bfd_link_hash_defined
+ || eh->root.type == bfd_link_hash_defweak);
+
value = (eh->root.u.def.value
+ eh->root.u.def.section->output_section->vma
+ eh->root.u.def.section->output_offset);
Elf_Internal_Rela rel;
bfd_byte *loc;
long dynindx;
+ struct elf_link_hash_entry *baseh;
asection *sec;
bfd_vma value, value2;
if (eh->dynindx == -1)
{
+ BFD_ASSERT (eh->root.type == bfd_link_hash_defined
+ || eh->root.type == bfd_link_hash_defweak);
+
value = (eh->root.u.def.value
+ eh->root.u.def.section->output_section->vma
+ eh->root.u.def.section->output_offset);
if (eh->root.u.def.section->flags & SEC_READONLY)
- {
- sec = hppa_info->text_hash_entry->root.u.def.section;
- value2 = sec->output_offset + sec->output_section->vma;
- dynindx = hppa_info->text_hash_entry->dynindx;
- }
+ baseh = hppa_info->text_hash_entry;
else
- {
- sec = hppa_info->data_hash_entry->root.u.def.section;
- value2 = sec->output_offset + sec->output_section->vma;
- dynindx = hppa_info->data_hash_entry->dynindx;
- }
+ baseh = hppa_info->data_hash_entry;
+
+ sec = baseh->root.u.def.section;
+ value2 = sec->output_offset + sec->output_section->vma;
+ dynindx = baseh->dynindx;
rel.r_addend = value - value2;
}
else
if (eh->dynindx == -1)
{
+ struct elf_link_hash_entry *baseh;
asection *sec, *sopd;
bfd_vma value, value2;
{
if (discarded_section (eh->root.u.def.section))
continue;
+
+ BFD_ASSERT (eh->root.type == bfd_link_hash_defined
+ || eh->root.type == bfd_link_hash_defweak);
+
value = (eh->root.u.def.value
+ eh->root.u.def.section->output_section->vma
+ eh->root.u.def.section->output_offset);
if (eh->root.u.def.section->flags & SEC_READONLY)
- {
- sec = hppa_info->text_hash_entry->root.u.def.section;
- value2 = sec->output_offset + sec->output_section->vma;
- dynindx = hppa_info->text_hash_entry->dynindx;
- }
+ baseh = hppa_info->text_hash_entry;
else
- {
- sec = hppa_info->data_hash_entry->root.u.def.section;
- value2 = sec->output_offset + sec->output_section->vma;
- dynindx = hppa_info->data_hash_entry->dynindx;
- }
+ baseh = hppa_info->data_hash_entry;
+
+ sec = baseh->root.u.def.section;
+ value2 = sec->output_offset + sec->output_section->vma;
+ dynindx = baseh->dynindx;
}
rel.r_addend = value - value2;
}
Elf_Internal_Rela rela;
bfd_byte *loc;
long dynindx;
+ struct elf_link_hash_entry *baseh;
asection *sec;
asection *sdlt, *sdltrel;
bfd_signed_vma addend = rel->r_addend;
rela.r_offset = dlt_offset + sdlt->output_offset + sdlt->output_section->vma;
if (sym_sec->flags & SEC_READONLY)
- {
- sec = hppa_info->text_hash_entry->root.u.def.section;
- dynindx = hppa_info->text_hash_entry->dynindx;
- }
+ baseh = hppa_info->text_hash_entry;
else
- {
- sec = hppa_info->data_hash_entry->root.u.def.section;
- dynindx = hppa_info->data_hash_entry->dynindx;
- }
+ baseh = hppa_info->data_hash_entry;
+
+ sec = baseh->root.u.def.section;
+ dynindx = baseh->dynindx;
/* Adjust addend using the difference of the symbol's
location and the section symbol's address. */
r_symndx) != -1)
{
bfd_vma out_off;
+ struct elf_link_hash_entry *baseh;
out_off = _bfd_elf_section_offset (output_bfd, info,
input_section,
/* Select base segment. */
if (sym_sec->flags & SEC_READONLY)
- {
- sec = hppa_info->text_hash_entry->root.u.def.section;
- dynindx = hppa_info->text_hash_entry->dynindx;
- }
+ baseh = hppa_info->text_hash_entry;
else
- {
- sec = hppa_info->data_hash_entry->root.u.def.section;
- dynindx = hppa_info->data_hash_entry->dynindx;
- }
+ baseh = hppa_info->data_hash_entry;
+
+ sec = baseh->root.u.def.section;
+ dynindx = baseh->dynindx;
/* Adjust addend using the difference of the symbol's
location and the section symbol's address. */