can't link with crtend.o

Alexander Gdalevich gdalevich@hotmail.com
Thu Feb 26 16:03:00 GMT 2004


Greetings!

I am using sh-elf crosscompiler to build a small program.  For some reason, 
I can't make it link with crtend.o

Here is my gcc (sh-elf-gcc) configuration:
--------------------------------------------------------------------------------------------------------------------
Configured with: ../gcc-3.3.2/configure --target=sh-elf 
--prefix=/gcc_build/sh4
--enable-languages=c,c++ --with-newlib --program-prefix=sh-elf- 
--disable-thread
s --with-gxx-include-dir=/gcc_build/sh4/sh-elf/include -v
--------------------------------------------------------------------------------------------------------------------

I am also using gnu linker (ld) version 2.14 built for the sh-elf target as 
well...


Here is how I build it:
sh-elf-gcc -c -m4 -Wall -Wa,-ahls=Program.lst  Program.cpp -o Program.o

sh-elf-ld -N -Ttext 0x08000000 -T prog.lnkscr Program.o crtend.o -lc -lm 
-lgcc -M -S -oformat=binary --verbose -o Program.bin > linkmap.map


Linker complains about an : undefined reference to `__do_global_ctors_aux

I've tried calling _do_global_ctors_aux as well, and even looked inside the 
crtend.o to make sure that the function is there, but it still would not 
link...

The most interesting thing, is that the map file generated contains code and 
data from crtend.o, but still cannot link the function.

Any ideas?



----------------------------------------------------------------
"Normal people ... believe that if it ain't broke, don't fix it. Engineers 
believe that if it ain't broke, it doesn't have enough features yet."

_________________________________________________________________
Dream of owning a home? Find out how in the First-time Home Buying Guide. 
http://special.msn.com/home/firsthome.armx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkmap.map
Type: application/octet-stream
Size: 5439 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20040226/fca341e9/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Program.cpp
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20040226/fca341e9/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prog.lnkscr
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20040226/fca341e9/attachment-0001.ksh>
-------------- next part --------------
------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


More information about the crossgcc mailing list