Demo 2106 link problems (ARM7)

vespaman2 wrote on Monday, September 08, 2008:

Hi,

This is my first project using ARM devices, and also FreeRtos, therefore I suppose my issues below are common knowledge here… :wink:

I am targetting a LPC2387 or similar device for my project. In order to get going rapidly, and to familirise myself with the environment I decided to compile the 2106 GCC demo.

Compilation went ok, but not the linking, and I think that it is basically a thumbmode issue, since the arm mode compiles+links OK.

{would you agree?}

Thing is, my understanding is that thumbmode is a good thing, and I’d like to use it. So fixing this issue is top on my todo list…

The toolchain where built using crossdev on gentoo linux, and I guess this is where I need to have libgcc support INTERWORKING somehow?

Thanks,

Micael

micke@atle ~/projects/FreeRTOS/Demo/ARM7_LPC2106_GCC $ make
arm-elf-gcc -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused -D RUN_FROM_RAM -D GCC_ARM7 -I. -I…/…/Source/include -I…/Common/include -g -mcpu=arm7tdmi -Tlpc2106-ram.ld -O0 -fomit-frame-pointer -fno-strict-aliasing -mthumb-interwork -D THUMB_INTERWORK …/…/Source/portable/GCC/ARM7_LPC2000/portISR.o serial/serialISR.o main.o serial/serial.o ParTest/ParTest.o …/Common/Minimal/integer.o …/Common/Minimal/flash.o …/Common/Minimal/PollQ.o …/Common/Minimal/comtest.o …/Common/Minimal/flop.o …/Common/Minimal/semtest.o …/Common/Minimal/dynamic.o …/Common/Minimal/BlockQ.o …/…/Source/tasks.o …/…/Source/queue.o …/…/Source/list.o …/…/Source/portable/MemMang/heap_2.o …/…/Source/portable/GCC/ARM7_LPC2000/port.o -nostartfiles boot.s -Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_udivsi3.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_divsi3.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_umodsi3.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_dvmd_tls.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_addsubdf3.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_muldivdf3.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/libgcc.a(_cmpdf2.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/…/…/…/…/arm-elf/lib/libg.a(lib_a-memcpy.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/…/…/…/…/arm-elf/lib/libg.a(lib_a-memset.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: Warning: /usr/lib/gcc/arm-elf/4.2.4/…/…/…/…/arm-elf/lib/libg.a(lib_a-strncpy.o) does not support interworking, whereas rtosdemo.elf does
/usr/libexec/gcc/arm-elf/ld: /usr/lib/gcc/arm-elf/4.2.4/…/…/…/…/arm-elf/lib/libg.a(lib_a-memset.o)(memset): warning: interworking not enabled.
  first occurrence: main.o: thumb call to arm
/usr/libexec/gcc/arm-elf/ld: BFD (GNU Binutils) 2.18 assertion fail /var/tmp/cross/arm-elf/portage/cross-arm-elf/binutils-2.18-r3/work/binutils-2.18/bfd/elf32-arm.c:6532
main.o: In function `vMemCheckTask’:
/home/micke/projects/FreeRTOS/Demo/ARM7_LPC2106_GCC/main.c:451: dangerous relocation: make: *** [rtosdemo.elf] Error 1

davedoors wrote on Tuesday, September 09, 2008:

Don’t know about Linux, but on Win32 I only ever use pre built GCC versions and have never come across this problem. Are there pre built GCC versions that can be tried on Linux?

From the error I would guess that you need to build libgcc with the -thumb-interwork compile time option.

vespaman2 wrote on Tuesday, September 09, 2008:

Thanks,

the libs are built with crossdev, which generates the full toolchain from sources automagically.

I have learned since about an hour, that crossdev actually are building both a arm and thumb variant of libgcc. So all I need to do is to find out where that default lib path is set. Which at this point is not obvious to me. :slight_smile:

But at least, I

chaalar wrote on Tuesday, September 09, 2008:

FYI, there are also pre-built toolchains at:

http://www.codesourcery.com/gnu_toolchains/arm/portal/subscription3053
http://www.gnuarm.com/

Regards,
Caglar