]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Accept --just-symbols symbols as absolute for xcoff
authorAlan Modra <amodra@gmail.com>
Mon, 27 Jul 2020 08:03:59 +0000 (17:33 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 27 Jul 2020 13:01:37 +0000 (22:31 +0930)
This patch is aimed at curing
    just-symbols-1.o: loader reloc in unrecognized section `*ABS*'
for xcoff by treating symbols defined by --just-symbols objects as
absolute.

* xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
similar as absolute.
(bfd_xcoff_import_symbol): Don't fuss over absolute symbol
redefinitions here.

bfd/ChangeLog
bfd/xcofflink.c

index b161e20c21e347a6e555df80c22488d4d1f91f8b..dfc3cbc04fdce12470109d103e6a5841e4dd639c 100644 (file)
@@ -1,3 +1,10 @@
+2020-07-27  Alan Modra  <amodra@gmail.com>
+
+       * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
+       similar as absolute.
+       (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
+       redefinitions here.
+
 2020-07-24  Nick Clifton  <nickc@redhat.com>
 
        * config.bfd: Move xc16x target to the obsolete list.
index 985e2217429242d6ab57a041fb84569db014a632..887052547219ce01b2f6c81bdaafecf52ddae1cf 100644 (file)
@@ -2685,9 +2685,17 @@ xcoff_need_ldrel_p (struct bfd_link_info *info, struct internal_reloc *rel,
     case R_RLA:
       /* Absolute relocations against absolute symbols can be
         resolved statically.  */
-      if (h != NULL && bfd_is_abs_symbol (&h->root))
-       return FALSE;
-
+      if (h != NULL
+         && (h->root.type == bfd_link_hash_defined
+             || h->root.type == bfd_link_hash_defweak)
+         && !h->root.rel_from_abs)
+       {
+         asection *sec = h->root.u.def.section;
+         if (bfd_is_abs_section (sec)
+             || (sec != NULL
+                 && bfd_is_abs_section (sec->output_section)))
+           return FALSE;
+       }
       return TRUE;
     }
 }
@@ -3118,9 +3126,7 @@ bfd_xcoff_import_symbol (bfd *output_bfd,
 
   if (val != (bfd_vma) -1)
     {
-      if (h->root.type == bfd_link_hash_defined
-         && (!bfd_is_abs_symbol (&h->root)
-             || h->root.u.def.value != val))
+      if (h->root.type == bfd_link_hash_defined)
        (*info->callbacks->multiple_definition) (info, &h->root, output_bfd,
                                                 bfd_abs_section_ptr, val);