[coldfire-gnu-discuss] Override printf
Corrin Meyer
Corrin.Meyer at dornerworks.com
Fri Jul 11 15:07:23 UTC 2008
>> I took a quick look at the linker script. I am using one of the
default
>> ones: m52235evb-rom.ld. Our board is modeled after the 52235EVB so
it
>> seemed like it would work quite nicely. Looking at this script I
don't
>> see any references to Newlib.
>
>Does it have a GROUP line for -lc?
>
>--
>Daniel Jacobowitz
>CodeSourcery
I just saw that. Yes it does. I made a copy of the linker script and
removed the "-lc" from the GROUP command. I also saw "-lgcc" so I am
not sure if I should remove that as well; leaving it for the time being.
Once I removed "-lc" it seems that Newlib is not longer getting
included, but now instead of warnings, I am getting errors:
GNU ld (Sourcery G++ Lite 4.2-125)
2.18.50.20080215CMakeFiles/firmware.elf.dir/src/main.c.o: In function
`main':
/home/CorrinMeyer/versimation/sw/1.1/src/firmware/src/main.c:17:
undefined reference to `puts'
c:/program files/codesourcery/sourcery g++
lite/bin/../lib/gcc/m68k-elf/4.2.3/../../../../m68k-elf/lib/m5208\libcs3
.a(start_c.o): In function `__cs3_start_c':
start_c.c:(.text+0x6a): undefined reference to `__libc_init_array
Now line main.c:17 is actually a printf and it should be calling my
printf. Not exactly sure why it is getting labeled as a reference to
'puts'. I have no idea what the undefined "__libc_init_array" is. Is
this a list of initialization functions that should be run by the C
library on start?
Corrin Meyer
More information about the coldfire-gnu-discuss
mailing list