Linker problems with arm-wince, need help/info

David Friedman dvdfrdmn at users.ess-eff.net
Tue Jun 13 16:48:35 PDT 2006


Chad J wrote:
> David Friedman wrote:
> 
>>
>> Two things to check:
>>
>> What is the order of libraries / objects on the linker command line? 
>> (Use gdc -v ...)
>>
>> Are the symbols actually defined in gphobos?  Use nm libgphobos.a to 
>> see if the names are actually definitions.
>>
>> David
> 
> 
> OK here is what I get when using the -v option:
> 
> Reading specs from 
> /usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3/../../../../arm-wince-pe/lib/specs 
> 
> Reading specs from 
> /usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3/../../../../arm-wince-pe/lib/libgphobos.spec 
> 
> rename spec lib to liborig
> Target: arm-wince-pe
> Configured with: /root/gcc/gdc-4.0.3/configure 
> --prefix=/usr/local/arm-wince-pe--disable-nls --disable-unix 
> --enable-multilib=no --enable-languages=c,d,c++ 
> --with-build-time-tools=/usr/local/arm-wince-pe/bin 
> --with-as=/usr/local/arm-wince-pe/bin/arm-wince-pe-as 
> --with-ld=/usr/local/arm-wince-pe/bin/arm-wince-pe-ld 
> --with-sysroot=/usr/local/arm-wince-pe 
> --enable-phobos-config-dir=/usr/local/arm-wince-pe/phobos-config 
> --target=arm-wince-pe
> Thread model: single
> gcc version 4.0.3 (gdc 0.18, using dmd 0.149)
>  /usr/local/arm-wince-pe/libexec/gcc/arm-wince-pe/4.0.3/cc1d main.d 
> -quiet -dumpbase main.d -auxbase main -version -fno-leading-underscore 
> -o /tmp/ccuAOxMx.s
> GNU D version 4.0.3 (gdc 0.18, using dmd 0.149) (arm-wince-pe)
>         compiled by GNU C version 3.3.5 (Debian 1:3.3.5-13).
> GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64492
>  /usr/local/arm-wince-pe/bin/arm-wince-pe-as -o /tmp/ccAPqn32.o 
> /tmp/ccuAOxMx.s
>  /usr/local/arm-wince-pe/libexec/gcc/arm-wince-pe/4.0.3/collect2 -X 
> -odtest.execrt0.o -L/usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3 
> -L/usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3/../../../../arm-wince-pe/lib 
> -L/usr/local/arm-wince-pe/lib -L/usr/local/arm-wince-pe/usr/lib 
> /tmp/ccAPqn32.o -lgphobos -lm -lm-lcdll -lcdllimp -lcoredll
> 
> 
> I searched in the result of nm libgphobos.a, and I found the missing 
> symbols there.  Not sure how to read it though, and from what I can make 
> of the binutils documentation on it I'll probably need to learn more 
> about linking to understand it.  Anyhow, you should be able to find it 
> at this link http://s17.quicksharing.com/v/8488120/1nm.txt.html (it was 
> too big to fit on the ng).

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



More information about the D.gnu mailing list