On 19/10/2017 11:47, sugar wrote: > /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/collect2 [...] > ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2458 > ld: fatal: bad section layout: .SUNW_ldynsym must precede and be adjacent to .dynsym > collect2: ld returned 1 exit status It seems that the (Solaris) linker doesn't like what the (GNU) assembler produced. What is the output of /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/collect2 -v On my Linux system, collect2 -v prints: collect2 version 7.2.0 /usr/bin/ld -v GNU ld (GNU Binutils for Ubuntu) 2.24 So basically, collect2 just invokes /usr/bin/ld (which is gnu ld on a Linux system) https://gcc.gnu.org/onlinedocs/gccint/Collect2.html