Lib change leads to larger executables

Walter Bright newshound at digitalmars.com
Fri Feb 23 13:10:16 PST 2007


kris wrote:
> Walter Bright wrote:
>> Sure, but in this particular case, it seems that "core" is being 
>> imported without referencing code in it. The only reason the compiler 
>> doesn't generate the char[][] TypeInfo is because an import defines 
>> it. The compiler does work on the assumption that if a module is 
>> imported, then it will also be linked in.
> This core module, and the entire locale package it resides in, is /not/ 
> imported by anything. I spelled that out clearly before. You're making 
> an assumption it is, somehow ... well, it is not. You can deduce that 
> from the fact that the link succeeds perfectly well without that package 
> existing in the library.

Then the typeinfo for char[][] is being generated by another module. I 
suggest it would be helpful to find that module. Grep is a handy tool 
for finding it.

What let me to assume that the typeinfo for char[][] was *only* in 
core.obj was your statement that core got linked in regardless of where 
in the lib it was. This doesn't make sense in the light of it being also 
in some other .obj file.

I suggest identifying which .obj files have the typeinfo marked as 
extern, and which have it defined as a COMDAT.



More information about the Digitalmars-d mailing list