[En-Nut-Discussion] Ethernut on TI's Cortex-M3 (Stellaris LM3S...)

Philipp Burch phip at hb9etc.ch
Mon Oct 29 21:55:31 CET 2012


Ole,

there is an addition to the linking problem mentioned before:

> The "multiple definition" errors probably arise because the linker sees
> nutcrt.a and the compiler's own libc. However, passing -nodefaultlibs
> and -lgcc does not solve anything, still the same errors.
>
> And what really looks strange are the "overlapping sections". I'm
> diggin' into some articles concerning this at the moment, maybe I'll
> figure it out. But if you could give me a hint, this would be greatly
> appreciated

Just tried the arm-eCross-eabi [1] and got some different output:


-------- 8< --------- 8< -----------

arm-eCross-eabi-gcc printing_to_strings.o -mcpu=cortex-m3 -mthumb 
-mlittle-endian -D__CORTEX__ -nostartfiles 
-L/home/phip/phipsfiles/developing/ethernut/ethernut-git/nut/arch/cm3/ldscripts 
-Tlm3s9b96_flash.ld 
-Wl,-Map=printing_to_strings.map,--cref,--gc-sections 
-L/home/phip/phipsfiles/developing/ethernut/ethernut-git/nutinstall-lm3 
-Wl,--start-group 
/home/phip/phipsfiles/developing/ethernut/ethernut-git/nutinstall-lm3/nutinit.o 
-lnutos -lnutarch -lnutdev -lnutarch -lnutcrt   -Wl,--end-group -o 
printing_to_strings.elf

/home/phip/Desktop/arm-eCross-eabi/bin/../lib/gcc/arm-eCross-eabi/4.5.2/../../../../arm-eCross-eabi/bin/ld: 
section .ARM.exidx loaded at [00006200,000062f7] overlaps section .data 
loaded at [00006200,00006b4f]

/home/phip/Desktop/arm-eCross-eabi/bin/../lib/gcc/arm-eCross-eabi/4.5.2/thumb/v7m/libgcc.a(unwind-arm.o): 
In function `get_eit_entry':
/home/ole/work/eCross/gcc-build/arm-eCross-eabi/thumb/v7m/libgcc/../../../../../src/gcc-4.5.2/libgcc/../gcc/config/arm/unwind-arm.c:614: 
undefined reference to `__exidx_start'
/home/ole/work/eCross/gcc-build/arm-eCross-eabi/thumb/v7m/libgcc/../../../../../src/gcc-4.5.2/libgcc/../gcc/config/arm/unwind-arm.c:614: 
undefined reference to `__exidx_end'

/home/phip/Desktop/arm-eCross-eabi/bin/../lib/gcc/arm-eCross-eabi/4.5.2/../../../../arm-eCross-eabi/lib/thumb/v7m/libc.a(lib_a-abort.o): 
In function `abort':
/home/ole/work/eCross/newlib-build/arm-eCross-eabi/thumb/v7m/newlib/libc/stdlib/../../../../../../../src/newlib-1.19.0/newlib/libc/stdlib/abort.c:63: 
undefined reference to `_exit'

/home/phip/Desktop/arm-eCross-eabi/bin/../lib/gcc/arm-eCross-eabi/4.5.2/../../../../arm-eCross-eabi/lib/thumb/v7m/libc.a(lib_a-signalr.o): 
In function `_kill_r':
/home/ole/work/eCross/newlib-build/arm-eCross-eabi/thumb/v7m/newlib/libc/reent/../../../../../../../src/newlib-1.19.0/newlib/libc/reent/signalr.c:61: 
undefined reference to `_kill'

/home/phip/Desktop/arm-eCross-eabi/bin/../lib/gcc/arm-eCross-eabi/4.5.2/../../../../arm-eCross-eabi/lib/thumb/v7m/libc.a(lib_a-signalr.o): 
In function `_getpid_r':
/home/ole/work/eCross/newlib-build/arm-eCross-eabi/thumb/v7m/newlib/libc/reent/../../../../../../../src/newlib-1.19.0/newlib/libc/reent/signalr.c:96: 
undefined reference to `_getpid'

/home/phip/Desktop/arm-eCross-eabi/bin/../lib/gcc/arm-eCross-eabi/4.5.2/../../../../arm-eCross-eabi/lib/thumb/v7m/libc.a(lib_a-sbrkr.o): 
In function `_sbrk_r':
/home/ole/work/eCross/newlib-build/arm-eCross-eabi/thumb/v7m/newlib/libc/reent/../../../../../../../src/newlib-1.19.0/newlib/libc/reent/sbrkr.c:60: 
undefined reference to `_sbrk'

collect2: ld returned 1 exit status
make: *** [printing_to_strings.elf] Error 1

-------- 8< --------- 8< -----------

So the multiple definitions are gone now, but instead there are more 
undefined references.

Cheers,
Philipp


[1] Version output:
printing_to_strings$ arm-eCross-eabi-gcc --version
arm-eCross-eabi-gcc (GCC) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


More information about the En-Nut-Discussion mailing list