Linker problems with arm-wince, need help/info

Chad J gamerChad at _spamIsBad_gmail.com
Tue Jun 13 22:42:01 PDT 2006


David Friedman wrote:
> 
> Something I noticed in the original message:
> 
> /usr/local/arm-wince-pe/EntryPoint/Console/crt0.o(.text+0x2c): undefined 
> reference to `main'
> 
> Looking at the nm output, all global symbols a prefixed with an 
> underscore.  It looks like the main in crt0.o doesn't have an underscore 
> (I don't think GNU ld removes prefixes for error messages.)  That might 
> be the problem.  Does the gcc built along with gdc have the same 
> problem?  Where does EntryPoint/Console/crt0.o come from?
> 
> David

It works for C and C plus plus, both for console apps and windows GUI 
apps.  Compiles without problems and runs correctly too, not sure about 
anything more advanced then that (like exception handling).  I should 
mention there is also an EntryPoint/Windows/crt0.o.  I wrote a dummy 
linker that tries to determine which kind of program you are writing, 
and calls the real linker with the appropriate startfile.  The 
startfiles themselves originate from some of the files Mamaich used in 
his arm-wince-pe C plus plus cross compiler.  The original crt0 
startfiles that came with the files I was using did not work - the 
compiler couldn't find the entry symbol on them.  To fix this I found 
the original assembly of crt0.o, crt0.S, and replaced the symbol I 
thought to be the intended entry point with the one that the 
compiler/linker was looking for, then assembled it.  I've attached what 
I believe to be the original crt0.S before my modifications, but it's 
been a while since I messed with it so I can't be sure if it's the right 
one.

I've noticed that in a x86-linux install of GDC, there are a number of 
startfile looking object files in lib/gcc/i686-pc-linux-gnu/4.0.3 - 
crtbegin.o, crtbeginS.o, crtbeginT.o, crtend.o, and crtendS.o.  There's 
about 8.5 KB of important looking code there, whereas the cross compiler 
I've made has just the one 676 KB startfile.  I'm wondering why those 
other files didn't build with this cross compiler, and if their lack 
might be the problem.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: crt0.S
Url: http://lists.puremagic.com/pipermail/d.gnu/attachments/20060614/241cc3dc/attachment.diff 


More information about the D.gnu mailing list