https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113183
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- GCC trunk fails with: ``` [apinski@xeond2 tt]$ ~/upstream-gcc/bin/gcc -nostartfiles -O2 -flto -T link.ld tt.cpp -o tt tt.cpp:18:90: warning: ‘retain’ attribute ignored [-Wattributes] 18 | static void const * const leon_init __attribute__((section (".init_array"), retain, used)) = (void*)leon_initialise; | ^ tt.cpp:18:27: error: ‘leon_init’ causes a section type conflict 18 | static void const * const leon_init __attribute__((section (".init_array"), retain, used)) = (void*)leon_initialise; | ^ lto-wrapper: fatal error: /home/apinski/upstream-gcc/bin/gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status ``` RedHat's GCC 11.3.1 fails with the same: ``` [apinski@xeond2 tt]$ gcc -nostartfiles -O2 -flto -T link.ld tt.cpp -o tt tt.cpp:18:90: warning: ‘retain’ attribute ignored [-Wattributes] 18 | static void const * const leon_init __attribute__((section (".init_array"), retain, used)) = (void*)leon_initialise; | ^ tt.cpp:18:27: error: ‘leon_init’ causes a section type conflict 18 | static void const * const leon_init __attribute__((section (".init_array"), retain, used)) = (void*)leon_initialise; | ^ lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status ```