+ * xcofflink.c (xcoff_link_input_bfd): If we already called the
+ undefined_symbol callback for a symbol, then don't issue any more
+ warnings about loader relocs.
+ (_bfd_ppc_xcoff_relocate_section): Don't do any further processing
+ after calling the undefined_symbol callback.
+
* xcofflink.c (XCOFF_MULTIPLY_DEFINED): Define.
(xcoff_link_add_symbols): Permit multiple definitions of a symbol
as the AIX linker seems to do.
{
struct xcoff_link_hash_entry *h = NULL;
struct internal_ldrel ldrel;
+ boolean quiet;
*rel_hash = NULL;
}
}
+ quiet = false;
switch (irel->r_type)
{
default:
}
else
{
- if (h->ldindx < 0)
+ if (! finfo->info->relocateable
+ && (h->flags & XCOFF_DEF_DYNAMIC) == 0
+ && (h->flags & XCOFF_IMPORT) == 0)
+ {
+ /* We already called the undefined_symbol
+ callback for this relocation, in
+ _bfd_ppc_xcoff_relocate_section. Don't
+ issue any more warnings. */
+ quiet = true;
+ }
+ if (h->ldindx < 0 && ! quiet)
{
(*_bfd_error_handler)
("%s: `%s' in loader reloc but not loader sym",
ldrel.l_rtype = (irel->r_size << 8) | irel->r_type;
ldrel.l_rsecnm = o->output_section->target_index;
if (xcoff_hash_table (finfo->info)->textro
- && strcmp (o->output_section->name, ".text") == 0)
+ && strcmp (o->output_section->name, ".text") == 0
+ && ! quiet)
{
(*_bfd_error_handler)
("%s: loader reloc in read-only section %s",
(info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma)))
return false;
+
+ /* Don't try to process the reloc. It can't help, and
+ it may generate another error. */
+ continue;
}
}