From 478409b71d3e80647904540e518897667bd352b2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 14 Jul 2023 10:46:50 +0930 Subject: [PATCH] AIX_WEAK_SUPPORT Making target code depend on a host define like _AIX52 is never correct, so out it goes. Also, sort some config.bfd entries a little to make it more obvious there is a config difference between aix5.1 and aix5.2. These two changes should make no difference to anything in binutils. The gas define of AIX_WEAK_SUPPORT on the other hand was wrong, so fix that. Finally, fix some testsuite fails on aix < 5.2 by simply not running the tests. include/ * coff/internal.h (C_WEAKEXT): Don't depend on _AIX52. bfd/ * coffcode.h (coff_slurp_symbol_table): Don't depend on _AIX52. (coff_classify_symbol): Likewise. * config.bfd: Sort some entries. gas/ * configure.ac (AIX_WEAK_SUPPORT): Don't set for aix5.[01]. * configure: Regenerate. * testsuite/gas/ppc/aix.exp (xcoff-visibility-1*) Don't run for aix < 5.2. --- bfd/coffcode.h | 4 ++-- bfd/config.bfd | 22 ++++++++++------------ gas/configure | 2 ++ gas/configure.ac | 2 ++ gas/testsuite/gas/ppc/aix.exp | 11 +++++++++-- include/coff/internal.h | 2 +- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 62720255b7f..f37d029ef75 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -4695,7 +4695,7 @@ coff_slurp_symbol_table (bfd * abfd) #endif #ifdef RS6000COFF_C case C_HIDEXT: -#if ! defined _AIX52 && ! defined AIX_WEAK_SUPPORT +#ifndef AIX_WEAK_SUPPORT case C_AIX_WEAKEXT: #endif #endif @@ -5021,7 +5021,7 @@ coff_classify_symbol (bfd *abfd, #endif #ifdef RS6000COFF_C case C_HIDEXT: -#if ! defined _AIX52 && ! defined AIX_WEAK_SUPPORT +#ifndef AIX_WEAK_SUPPORT case C_AIX_WEAKEXT: #endif #endif diff --git a/bfd/config.bfd b/bfd/config.bfd index 954837033c8..81ddbcd09c9 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1098,18 +1098,6 @@ case "${targ}" in targ_selvecs="rs6000_xcoff64_aix_vec" want64=true ;; - powerpc-*-haiku*) - targ_defvec=powerpc_elf32_vec - targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec pef_vec pef_xlib_vec powerpc_xcoff_vec powerpc_boot_vec" - targ_cflags=-D__HAIKU_TARGET__ - ;; -#ifdef BFD64 - powerpc64-*-aix5.[01]) - targ_defvec=rs6000_xcoff64_aix_vec - targ_selvecs="rs6000_xcoff_vec" - want64=true - ;; -#endif powerpc-*-aix[5-9]* | rs6000-*-aix[5-9]*) targ_cflags=-DAIX_WEAK_SUPPORT targ_defvec=rs6000_xcoff_vec @@ -1117,6 +1105,11 @@ case "${targ}" in want64=true ;; #ifdef BFD64 + powerpc64-*-aix5.[01]) + targ_defvec=rs6000_xcoff64_aix_vec + targ_selvecs="rs6000_xcoff_vec" + want64=true + ;; powerpc64-*-aix[5-9]*) targ_cflags=-DAIX_WEAK_SUPPORT targ_defvec=rs6000_xcoff64_aix_vec @@ -1176,6 +1169,11 @@ case "${targ}" in targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec powerpc_boot_vec" targ64_selvecs="powerpc_elf64_vec powerpc_elf64_le_vec" ;; + powerpc-*-haiku*) + targ_defvec=powerpc_elf32_vec + targ_selvecs="rs6000_xcoff_vec powerpc_elf32_le_vec pef_vec pef_xlib_vec powerpc_xcoff_vec powerpc_boot_vec" + targ_cflags=-D__HAIKU_TARGET__ + ;; powerpc-*-kaos*) targ_defvec=powerpc_elf32_vec targ_selvecs="powerpc_elf32_le_vec powerpc_boot_vec" diff --git a/gas/configure b/gas/configure index 70fd348c4d8..86d90abf4e6 100755 --- a/gas/configure +++ b/gas/configure @@ -12107,6 +12107,8 @@ $as_echo "#define STRICTCOFF 1" >>confdefs.h microblaze*) ;; + ppc-*-aix5.[01]*) + ;; ppc-*-aix[5-9].*) $as_echo "#define AIX_WEAK_SUPPORT 1" >>confdefs.h diff --git a/gas/configure.ac b/gas/configure.ac index 03728ffce4d..96eeb78db76 100644 --- a/gas/configure.ac +++ b/gas/configure.ac @@ -272,6 +272,8 @@ for this_target in $target $canon_targets ; do ;; changequote(,)dnl + ppc-*-aix5.[01]*) + ;; ppc-*-aix[5-9].*) changequote([,])dnl AC_DEFINE(AIX_WEAK_SUPPORT, 1, diff --git a/gas/testsuite/gas/ppc/aix.exp b/gas/testsuite/gas/ppc/aix.exp index 55aedc48654..76ffb224c08 100644 --- a/gas/testsuite/gas/ppc/aix.exp +++ b/gas/testsuite/gas/ppc/aix.exp @@ -88,8 +88,15 @@ if { [istarget "powerpc*-*-aix*"] || [istarget "rs6000-*-aix*"] } then { run_dump_test "xcoff-file-32" run_dump_test "xcoff-file-64" - run_dump_test "xcoff-visibility-1-32" - run_dump_test "xcoff-visibility-1-64" + if { [istarget {*-*-aix[6-9]*}] + || [istarget {*-*-aix5.[2-9]*}] } { + # The expected output of these tests depends on AIX_WEAK_SUPPORT. + # Without that weak syms do not have an aux entry and thus + # BFD_NOT_AT_END is not set. I don't know if any of this is + # correct.. + run_dump_test "xcoff-visibility-1-32" + run_dump_test "xcoff-visibility-1-64" + } run_dump_test "xcoff-visibility-2-32" run_dump_test "xcoff-visibility-2-64" } diff --git a/include/coff/internal.h b/include/coff/internal.h index 92a0abfd4f1..7a566caa057 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -352,7 +352,7 @@ struct internal_aouthdr #define C_NULL_VALUE 0x00de1e00 /* Value for a C_NULL deleted entry. */ -#if defined _AIX52 || defined AIX_WEAK_SUPPORT +#ifdef AIX_WEAK_SUPPORT #undef C_WEAKEXT #define C_WEAKEXT C_AIX_WEAKEXT #endif -- 2.30.2