[linux-sh:03179] can't link with crtend.o

"Alexander Gdalevich" <[email protected]> Sat, 28 Feb 2004 01:03:35 -0500
Newsgroups gmane.linux.ports.sh.general
Message-ID <[email protected]>
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.

Had anyone on this list successfully built an  sh4 cross-compiler?  Had 
anyone ever experienced a similar problem?






----------------------------------------------------------------
"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."

_________________________________________________________________
Watch high-quality video with fast playback at MSN Video. Free! 
http://click.atdmt.com/AVE/go/onm00200365ave/direct/01/