Help! arm-wince-pe undefined references.

Chad J gamerChad at _spamIsBad_gmail.com
Fri Jul 28 16:50:26 PDT 2006


Since the thread about arm-wince-pe-gdc when I had a bunch of undefined 
references, I've managed to work it down to a remaining few.  This all 
happens when linking a small helloworld type app.  These are the ones I 
don't know how to fix:

/usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3/../../../../arm-wince-pe/lib/libgphobos.a(boxer.o): 
In function 
`_D3std5boxer3Box13findTypeClassFC8TypeInfoZE3std5boxer9TypeClass':
/root/gcc/gdc-4.0.3/libphobos/std/boxer.d:192: undefined reference to 
`_init_19TypeInfo_C8TypeInfo'
/root/gcc/gdc-4.0.3/libphobos/std/boxer.d:192: undefined reference to 
`_init_24TypeInfo_S3std5boxer3Box'
/usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3/../../../../arm-wince-pe/lib/libgphobos.a(win32.o): 
In function `_D5win3222os_query_staticdatasegFPPvPkZv':
/root/gcc/gdc-4.0.3/libphobos/internal/gc/win32.d:134: undefined 
reference to `_data_start__'
/root/gcc/gdc-4.0.3/libphobos/internal/gc/win32.d:134: undefined 
reference to `_bss_end__'

For the std.boxer stuff, I grepped around for that _init_ typeinfo 
stuff, but didn't have any success.  Here is what that part of the file 
looks like:

private static TypeClass findTypeClass(TypeInfo type)
{
     if (cast(TypeInfo_Class) type)
         return TypeClass.Class;
     if (cast(TypeInfo_Pointer) type)
         return TypeClass.Pointer;
     if (isArrayTypeInfo(type))
         return TypeClass.Array;

     version (DigitalMars_TypeInfo)
     {
         /* Depend upon the name of the base type classes. */
         if (type.classinfo.name.length != "TypeInfo_?".length)
             return TypeClass.Other;
         switch (type.classinfo.name[9])
         {
             //case 'b': return TypeClass.Bit;
             case 'x': return TypeClass.Bool;
             case 'g', 'h', 's', 't', 'i', 'k', 'l', 'm': return 
TypeClass.Integer;
             case 'f', 'd', 'e': return TypeClass.Float;
             case 'q', 'r', 'c': return TypeClass.Complex;
             case 'o', 'p', 'j': return TypeClass.Imaginary;
/*ln 192*/  default: return TypeClass.Other;                  // Line 192
         }
     }
     else
     {
         /* Use the name returned from toString, which might (but 
hopefully doesn't) include an allocation. */
         switch (type.toString)
         {
             case "bool": return TypeClass.Bool;
             case "byte", "ubyte", "short", "ushort", "int", "uint", 
"long", "ulong": return TypeClass.Integer;
             case "float", "real", "double": return TypeClass.Float;
             case "cfloat", "cdouble", "creal": return TypeClass.Complex;
             case "ifloat", "idouble", "ireal": return TypeClass.Imaginary;
             default: return TypeClass.Other;
         }
     }
}

If I comment out that line then the error just moves to another place 
where TypeInfo was used.


As for

`_D5win3222os_query_staticdatasegFPPvPkZv':
/root/gcc/gdc-4.0.3/libphobos/internal/gc/win32.d:134: undefined 
reference to `_data_start__'
/root/gcc/gdc-4.0.3/libphobos/internal/gc/win32.d:134: undefined 
reference to `_bss_end__'

it comes from here:

version (GNU)
{
// This is MinGW specific
extern (C)
{
     // TODO: skip the .rdata between .data and .bss?
     extern int _data_start__;
     extern int _bss_end__;
}

void os_query_staticdataseg(void **base, uint *nbytes)
{
     *base = cast(void *)&_data_start__;
     *nbytes = cast(uint)(cast(char *)&_bss_end__ - cast(char 
*)&_data_start__);
}

}
else
{

extern (C)
{
     extern int _xi_a;   // &_xi_a just happens to be start of data segment
     extern int _edata;  // &_edata is start of BSS segment
     extern int _end;    // &_end is past end of BSS
}

void os_query_staticdataseg(void **base, uint *nbytes)
{
     *base = cast(void *)&_xi_a;
     *nbytes = cast(uint)(cast(char *)&_end - cast(char *)&_xi_a);
}

}

I have also made it use the non-GNU version, which then yields the error

/usr/local/arm-wince-pe/lib/gcc/arm-wince-pe/4.0.3/../../../../arm-wince-pe/lib/libgphobos.a(win32.o): 
In function `_D5win3222os_query_staticdatasegFPPvPkZv':
/root/gcc/gdc-4.0.3/libphobos/internal/gc/win32.d:150: undefined 
reference to `_xi_a'

I could really use some help fixing these errors.  They are stopping me 
from creating a wince executable in D.

Also, what does os_query_staticdataseg do?



More information about the D.gnu mailing list