Linking problems with gcc 3.4.5

nobody wrote on Wednesday, January 04, 2006:

Hi
I’m trying to cross-compile on a Linux box using arm-linux-gcc v3.4.5.
This compiler compiles uClinux-2.4 without error but all of the ARM7 Demos fail linking with the output …

collect2: ld terminated with signal 11 [Segmentation fault]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .dynamic [00000000 -> 0000009f] overlaps section startup [00000000 -> 00000043]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .got.plt [000000a0 -> 000000bf] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .interp [000000a0 -> 000000b2] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .gnu.version [000000b4 -> 000000bf] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .gnu.version_r [000000c0 -> 000000df] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .dynsym [000000e0 -> 0000013f] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .dynstr [00000140 -> 00000178] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .hash [0000017c -> 000001a7] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .rel.dyn [000001a8 -> 000001cf] overlaps section prog [00000044 -> 00003f4f]
/usr/arm/lib/gcc/arm-linux/3.4.5/…/…/…/…/arm-linux/bin/ld: section .plt [000001d0 -> 0000021f] overlaps section prog [00000044 -> 00003f4f]

Does anyone know what I’m doing wrong?

nobody wrote on Wednesday, January 04, 2006:

Which linker script and startup code are you using?  The sections mentioned in this extract are not present in the files included in the FreeRTOS download.

nobody wrote on Wednesday, January 04, 2006:

I’ve sorted it out.
The above was from the WizNET_DEMO_GCC_ARM7.

The toolchain was trying to link in /lib/ld-linux.so.2.
I needed to add "-static" to the linker flags in the  Makefile.

Thanks for the response.