summaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index d1a78abfcc7..d46d78c5c43 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -696,6 +696,10 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
one pass. */
*again = FALSE;
+ /* Don't even try to relax for non-ELF outputs. */
+ if (link_info->hash->creator->flavour != bfd_target_elf_flavour)
+ return FALSE;
+
/* Nothing to do if there are no relocations. */
if ((sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0)
@@ -819,6 +823,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
tsec = ia64_info->plt_sec;
toff = dyn_i->plt2_offset;
+ BFD_ASSERT (irel->r_addend == 0);
}
/* Can't do anything else with dynamic symbols. */
@@ -837,10 +842,15 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
}
}
- symaddr = (tsec->output_section->vma
- + tsec->output_offset
- + toff
- + irel->r_addend);
+ if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE)
+ toff = _bfd_merged_section_offset (abfd, &tsec,
+ elf_section_data (tsec)->sec_info,
+ toff + irel->r_addend,
+ (bfd_vma) 0);
+ else
+ toff += irel->r_addend;
+
+ symaddr = tsec->output_section->vma + tsec->output_offset + toff;
roff = irel->r_offset;
@@ -1965,7 +1975,11 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
struct elfNN_ia64_local_hash_entry *loc_h;
loc_h = get_local_sym_hash (ia64_info, abfd, rel, create);
- BFD_ASSERT (loc_h);
+ if (!loc_h)
+ {
+ BFD_ASSERT (!create);
+ return NULL;
+ }
pp = &loc_h->info;
}