XCOFF C_HIDEXT and C_AIX_WEAKEXT classification
authorAlan Modra <amodra@gmail.com>
Mon, 6 Jul 2020 23:57:17 +0000 (09:27 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 7 Jul 2020 08:56:33 +0000 (18:26 +0930)
If C_HIDEXT and C_AIX_WEAKEXT symbols aren't handled as globals by
coff_classify_symbol then we run into "warning: .. local symbol `some
garbage name' has no section".  These are of course both global
symbols, but C_HIDEXT is like a local in some respects and returning
COFF_SYMBOL_LOCAL for C_HIDEXT keeps nm output looking the same.
Fixes these fails on rs6000-aix5.1:

-FAIL: weakref tests, relocations
-FAIL: weakref tests, global syms
-FAIL: weakref tests, strong undefined syms
-FAIL: weakref tests, weak undefined syms

* coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
C_AIX_WEAKEXT.

bfd/ChangeLog
bfd/coffcode.h

index 02413ebdeb04453ee37b97ac47596b8c5526026e..057bc05aa8097f2ea1077811c6090b381cfe02c3 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-07  Alan Modra  <amodra@gmail.com>
+
+       * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
+       C_AIX_WEAKEXT.
+
 2020-07-06  Nick Clifton  <nickc@redhat.com>
 
        * po/pt.po: Updated Portuguese translation.
index 9a97ba740f541d38c2b731288947275435b4936d..0910f918d13bf46394e3d3f3da40055fd2aa7a79 100644 (file)
@@ -4904,6 +4904,12 @@ coff_classify_symbol (bfd *abfd,
     case C_THUMBEXT:
     case C_THUMBEXTFUNC:
 #endif
+#ifdef RS6000COFF_C
+    case C_HIDEXT:
+#if ! defined _AIX52 && ! defined AIX_WEAK_SUPPORT
+    case C_AIX_WEAKEXT:
+#endif
+#endif
 #ifdef C_SYSTEM
     case C_SYSTEM:
 #endif
@@ -4917,6 +4923,10 @@ coff_classify_symbol (bfd *abfd,
          else
            return COFF_SYMBOL_COMMON;
        }
+#ifdef RS6000COFF_C
+      if (syment->n_sclass == C_HIDEXT)
+       return COFF_SYMBOL_LOCAL;
+#endif
       return COFF_SYMBOL_GLOBAL;
 
     default:
This page took 0.026392 seconds and 4 git commands to generate.