[arm-gnu] undefined reference to _init
Brad Badke
BBadke at hemispheregps.com
Tue Oct 16 19:15:25 UTC 2012
I am converting my ARM code to over to CodeSourcery. I am using both C and C++. In my ARM code I called __rt_entry to initialize the C run time library and jump to my main(). In my startup.S file for CodeSourcery I have done the following:
@Invoke all static constructors
ldr r12,=__libc_init_array
@ ldr r12,= __cs3_start_c
mov lr,pc @set the return address
BX r12 @the target code can be ARM or THUMB
ldr r12,=main @Enter the C/C++ code
mov lr,pc @set the return address
bx r12 @the target code can be ARM or THUMB
@@@ BL __rt_entry @@This is what we did for ARM compiler
This results in the following linker error:
In function `__libc_init_array': init.c:(.text+0x40): undefined reference to `_init'
Any ideas on what I need to re-implement or link in?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/arm-gnu/attachments/20121016/9a13bc37/attachment.html>
More information about the arm-gnu
mailing list