This patch enables visibility support for AIX. AIX of course chose different syntax, so the default machinery isn't usable. AIX appends the visibility to the .globl and .comm pseudo-ops.
Within the rs6000 port, this patch only affects AIX / XCOFF. Also, because visibility support implicitly enables other features in GCC, some of which conflict with AIX, I had to disable the additional features. Because AIX uses DWARF for EH but places the DWARF information in the data section, the use of DWARF references and force_constant_mem conflicts with the data section. For this reason, USE_LINKONCE_INDIRECT is disabled in dwarf2asm.c. This patch also adjusts gcc/configure to set HAVE_GAS_HIDDEN. AIX ld support for hidden is forced true because the assembler test will catch if support is present. A number of testsuite tweaks also are necessary to XFAIL some visibility tests on AIX. Bootstrapped on powerpc-ibm-aix7.2.0.0 and powerpc64le-ibm-linux-gnu. Are the changes to configure and dwarf2asm.c okay? * configure.ac (.hidden): Change to conftest_s string. Provide string for AIX assembler. (gcc_cv_ld_hidden): Yes for AIX. * configure: Regenerate. * dwarf2asm.c (USE_LINKONCE_INDIRECT): Don't set for AIX (XCOFF). * config/rs6000/rs6000-protos.h (rs6000_xcoff_asm_output_aligned_decl_common): Declare. * config/rs6000/xcoff.h (TARGET_ASM_GLOBALIZE_DECL_NAME): Define. (ASM_OUTPUT_ALIGNED_DECL_COMMON): Define. (ASM_OUTPUT_ALIGNED_COMMON): Delete. * config/rs6000/rs6000.c (rs6000_xcoff_visibility): New. (rs6000_xcoff_declare_function_name): Add visibility support. (rs6000_xcoff_asm_globalize_decl_name): New. (rs6000_xcoff_asm_output_aligned_decl_common): New. (rs6000_code_end): Disable HIDDEN_LINKONCE on XCOFF. Thanks, David
ZZ
Description: Binary data