From 8af7926f455328bfc34456f6765c0cb1801e758e Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 7 Jul 2020 09:27:17 +0930 Subject: [PATCH] XCOFF C_HIDEXT and C_AIX_WEAKEXT classification 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 | 5 +++++ bfd/coffcode.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 02413ebdeb..057bc05aa8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-07-07 Alan Modra + + * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and + C_AIX_WEAKEXT. + 2020-07-06 Nick Clifton * po/pt.po: Updated Portuguese translation. diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 9a97ba740f..0910f918d1 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -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: -- 2.34.1