http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584
--- Comment #3 from Larry Baker <baker at usgs dot gov> 2012-09-18 21:43:32 UTC --- I don't know how to attach gdb to the ld.real called by collect2. So, I added a bunch of debugging output to bfd/elflink.c to find out where the failure occurs. (I'll attach my hacked version.) Here's the link without -elf2flt and with -elf2flt. The object files/libraries are the same, yet the program sections that ld.real sees are quite different. $ COMPILER_PATH=/tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/:/usr/local/gcc-4.7.1/m68k-uclinux/bin/:/usr/local/gcc-4.7.1/m68k-uclinux/lib/ /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/collect2 --sysroot=/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data --eh-frame-hdr -o conftest -t /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crt1.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crti.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtbegin.o -L/tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data -L/usr/local/gcc-4.7.1/m68k-uclinux/lib/msep-data -L/tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc -L/usr/local/gcc-4.7.1/m68k-uclinux/bin -L/usr/local/gcc-4.7.1/m68k-uclinux/lib -L/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib conftest.o -lgcc -lc -lgcc /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtend.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crtn.o /usr/local/gcc-4.7.1/m68k-uclinux/bin/ld.real: mode m68kelf /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crt1.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crti.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtbegin.o conftest.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)__uClibc_main.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)strrchr.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)exit.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)_exit.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)__errno_location.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)strchr.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)errno.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtend.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crtn.o ---> ldwrite: pid = 81433 ---> ldwrite: lang_for_each_statement() ---> ldwrite: bfd_final_link() ---> bfd_elf_final_link: ---> bfd_elf_final_link: remove input section .init ---> bfd_elf_final_link: remove input section .text ---> bfd_elf_final_link: remove input section .fini ---> bfd_elf_final_link: remove input section .rodata ---> bfd_elf_final_link: remove input section .eh_frame ---> bfd_elf_final_link: remove input section .ctors ---> bfd_elf_final_link: remove input section .dtors ---> bfd_elf_final_link: remove input section .jcr ---> bfd_elf_final_link: remove input section .got ---> bfd_elf_final_link: remove input section .data ---> bfd_elf_final_link: remove input section .bss ---> bfd_elf_final_link: remove input section .comment ---> bfd_elf_final_link: count relocations for section .init ---> bfd_elf_final_link: count relocations for section .text ---> bfd_elf_final_link: count relocations for section .fini ---> bfd_elf_final_link: count relocations for section .rodata ---> bfd_elf_final_link: count relocations for section .eh_frame ---> bfd_elf_final_link: count relocations for section .ctors ---> bfd_elf_final_link: count relocations for section .dtors ---> bfd_elf_final_link: count relocations for section .jcr ---> bfd_elf_final_link: count relocations for section .got ---> bfd_elf_final_link: count relocations for section .data ---> bfd_elf_final_link: count relocations for section .bss ---> bfd_elf_final_link: count relocations for section .comment ---> bfd_elf_final_link: set size, file position for section .init ---> bfd_elf_final_link: set size, file position for section .text ---> bfd_elf_final_link: set size, file position for section .fini ---> bfd_elf_final_link: set size, file position for section .rodata ---> bfd_elf_final_link: set size, file position for section .eh_frame ---> bfd_elf_final_link: set size, file position for section .ctors ---> bfd_elf_final_link: set size, file position for section .dtors ---> bfd_elf_final_link: set size, file position for section .jcr ---> bfd_elf_final_link: set size, file position for section .got ---> bfd_elf_final_link: set size, file position for section .data ---> bfd_elf_final_link: set size, file position for section .bss ---> bfd_elf_final_link: set size, file position for section .comment ---> bfd_elf_final_link: output symbol for section .init ---> bfd_elf_final_link: output symbol for section .text ---> bfd_elf_final_link: output symbol for section .fini ---> bfd_elf_final_link: output symbol for section .rodata ---> bfd_elf_final_link: output symbol for section .eh_frame ---> bfd_elf_final_link: output symbol for section .ctors ---> bfd_elf_final_link: output symbol for section .dtors ---> bfd_elf_final_link: output symbol for section .jcr ---> bfd_elf_final_link: output symbol for section .got ---> bfd_elf_final_link: output symbol for section .data ---> bfd_elf_final_link: output symbol for section .bss ---> bfd_elf_final_link: output symbol for section .comment ---> bfd_elf_final_link: reorder section .init ---> bfd_elf_final_link: reorder section .text ---> bfd_elf_final_link: reorder section .fini ---> bfd_elf_final_link: reorder section .rodata ---> bfd_elf_final_link: reorder section .eh_frame ---> bfd_elf_final_link: reorder section .ctors ---> bfd_elf_final_link: reorder section .dtors ---> bfd_elf_final_link: reorder section .jcr ---> bfd_elf_final_link: reorder section .got ---> bfd_set_error: bfd_error_nonrepresentable_section ---> bfd_set_error: bfd_error_nonrepresentable_section ---> bfd_elf_final_link: reorder section .data ---> bfd_elf_final_link: reorder section .bss ---> bfd_elf_final_link: reorder section .comment ---> bfd_elf_final_link: output local symbols for section .init ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: output local symbols for section .text ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: _bfd_default_link_order() ---> bfd_elf_final_link: _bfd_default_link_order() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: _bfd_default_link_order() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: _bfd_default_link_order() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: output local symbols for section .fini ---> bfd_elf_final_link: output local symbols for section .rodata ---> bfd_elf_final_link: output local symbols for section .eh_frame ---> bfd_elf_final_link: output local symbols for section .ctors ---> bfd_elf_final_link: output local symbols for section .dtors ---> bfd_elf_final_link: output local symbols for section .jcr ---> bfd_elf_final_link: output local symbols for section .got ---> bfd_elf_final_link: output local symbols for section .data ---> bfd_elf_final_link: output local symbols for section .bss ---> bfd_elf_final_link: output local symbols for section .comment ---> bfd_elf_final_link: adjust relocs for section .init ---> bfd_elf_final_link: adjust relocs for section .text ---> bfd_elf_final_link: adjust relocs for section .fini ---> bfd_elf_final_link: adjust relocs for section .rodata ---> bfd_elf_final_link: adjust relocs for section .eh_frame ---> bfd_elf_final_link: adjust relocs for section .ctors ---> bfd_elf_final_link: adjust relocs for section .dtors ---> bfd_elf_final_link: adjust relocs for section .jcr ---> bfd_elf_final_link: adjust relocs for section .got ---> bfd_elf_final_link: adjust relocs for section .data ---> bfd_elf_final_link: adjust relocs for section .bss ---> bfd_elf_final_link: adjust relocs for section .comment ---> bfd_elf_final_link: output dynamic section .text ---> bfd_elf_final_link: output dynamic section .data ---> bfd_elf_final_link: output dynamic section .bss ---> bfd_elf_final_link: output dynamic section .ctors ---> bfd_elf_final_link: output dynamic section .dtors ---> bfd_elf_final_link: output dynamic section .eh_frame ---> bfd_elf_final_link: output dynamic section .jcr ---> bfd_elf_final_link: output dynamic section .tm_clone_table ---> bfd_elf_final_link: output dynamic section .fini ---> bfd_elf_final_link: output dynamic section .init ---> bfd_elf_final_link: output dynamic section .comment ---> bfd_elf_final_link: output dynamic section .note.GNU-stack ---> bfd_elf_final_link: output dynamic section .rela.got ---> bfd_elf_final_link: output dynamic section .got ---> bfd_elf_final_link: output dynamic section .got.plt ---> bfd_elf_final_link: normal return ---> bfd_elf_final_link: return TRUE $ COMPILER_PATH=/tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/:/usr/local/gcc-4.7.1/m68k-uclinux/bin/:/usr/local/gcc-4.7.1/m68k-uclinux/lib/ /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/collect2 --sysroot=/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data --eh-frame-hdr -elf2flt -o conftest -t /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crt1.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crti.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtbegin.o -L/tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data -L/usr/local/gcc-4.7.1/m68k-uclinux/lib/msep-data -L/tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc -L/usr/local/gcc-4.7.1/m68k-uclinux/bin -L/usr/local/gcc-4.7.1/m68k-uclinux/lib -L/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib conftest.o -lgcc -lc -lgcc /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtend.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crtn.o /usr/local/gcc-4.7.1/m68k-uclinux/bin/ld.real: mode m68kelf /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crt1.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crti.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtbegin.o conftest.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)__uClibc_main.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)strrchr.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)exit.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)_exit.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)__errno_location.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)strchr.o (/tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/libc.a)errno.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7.1/gcc/msep-data/crtend.o /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/libc/msep-data/usr/lib/crtn.o ---> ldwrite: pid = 81437 ---> ldwrite: lang_for_each_statement() ---> ldwrite: bfd_final_link() ---> bfd_elf_final_link: ---> bfd_elf_final_link: remove input section .text ---> bfd_elf_final_link: remove input section .data ---> bfd_elf_final_link: remove input section .eh_frame ---> bfd_elf_final_link: remove input section .bss ---> bfd_elf_final_link: remove input section .comment ---> bfd_elf_final_link: count relocations for section .text ---> bfd_elf_final_link: count relocations for section .data ---> bfd_elf_final_link: count relocations for section .eh_frame ---> bfd_elf_final_link: count relocations for section .bss ---> bfd_elf_final_link: count relocations for section .comment ---> bfd_elf_final_link: set size, file position for section .text ---> bfd_elf_final_link: set size, file position for section .data ---> bfd_elf_final_link: set size, file position for section .eh_frame ---> bfd_elf_final_link: set size, file position for section .bss ---> bfd_elf_final_link: set size, file position for section .comment ---> bfd_elf_final_link: output symbol for section .text ---> bfd_elf_final_link: output symbol for section .data ---> bfd_elf_final_link: output symbol for section .eh_frame ---> bfd_elf_final_link: output symbol for section .bss ---> bfd_elf_final_link: output symbol for section .comment ---> bfd_elf_final_link: reorder section .text ---> bfd_elf_final_link: reorder section .data ---> bfd_set_error: bfd_error_nonrepresentable_section ---> bfd_set_error: bfd_error_nonrepresentable_section ---> bfd_elf_final_link: reorder section .eh_frame ---> bfd_elf_final_link: reorder section .bss ---> bfd_elf_final_link: reorder section .comment ---> bfd_elf_final_link: output local symbols for section .text ---> bfd_elf_final_link: _bfd_default_link_order() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: _bfd_default_link_order() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_elf_final_link: elf_link_input_bfd() ---> bfd_set_error: bfd_error_nonrepresentable_section ---> bfd_elf_final_link: ... failed ---> bfd_elf_final_link: error return ---> bfd_elf_final_link: return FALSE /usr/local/gcc-4.7.1/m68k-uclinux/bin/ld.real: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status I have to move on to more pressing problems. Since I don't need Transactional Memory support anyway, I'm happy enough to use my patch which disables it for uClinux and move on.