The code that collect2 generates, compiles and links into applications
and shared libraries to initialize constructors and register DWARF tables
is built with the compiler options used to invoke the linker.  If the
compiler options change the visibility from default, the library
initialization routines will not be visible and this can prevent
initialization.

This patch checks if the command line sets visibiliity and then adds
GCC pragmas to the initialization code generated by collect2 if
necessary to define the visibility on global, exported functions as default.

Bootstrapped on powerpc-ibm-aix7.2.0.0

Thanks, David

gcc/ChangeLog:

2020-09-26  David Edelsohn  <dje....@gmail.com>
                Clement Chigot  <clement.chi...@atos.com>

            * collect2.c (visibility_flag): New.
            (main): Detect -fvisibility.
            (write_c_file_stat): Push and pop default visibility.

Attachment: 0001-aix-collect2-visibility.patch
Description: Binary data

Reply via email to