* xcofflink.c (xcoff_link_input_bfd): If we already called the
authorIan Lance Taylor <ian@airs.com>
Thu, 8 Aug 1996 21:15:32 +0000 (21:15 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 8 Aug 1996 21:15:32 +0000 (21:15 +0000)
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.

bfd/ChangeLog
bfd/xcofflink.c

index 16ff9cf..3a5fa59 100644 (file)
@@ -1,5 +1,11 @@
 Thu Aug  8 16:24:55 1996  Ian Lance Taylor  <ian@cygnus.com>
 
+       * 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.
index 8477444..3892f17 100644 (file)
@@ -5185,6 +5185,7 @@ xcoff_link_input_bfd (finfo, input_bfd)
            {
              struct xcoff_link_hash_entry *h = NULL;
              struct internal_ldrel ldrel;
+             boolean quiet;
 
              *rel_hash = NULL;
 
@@ -5310,6 +5311,7 @@ xcoff_link_input_bfd (finfo, input_bfd)
                    }
                }
 
+             quiet = false;
              switch (irel->r_type)
                {
                default:
@@ -5361,7 +5363,17 @@ xcoff_link_input_bfd (finfo, input_bfd)
                    }
                  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",
@@ -5375,7 +5387,8 @@ xcoff_link_input_bfd (finfo, input_bfd)
                  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",
@@ -6152,6 +6165,10 @@ _bfd_ppc_xcoff_relocate_section (output_bfd, info, input_bfd,
                     (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;
            }
        }