Solutions to the TypeInfo dependency injection issue?

Pragma ericanderton at yahoo.removeme.com
Mon Mar 12 07:21:30 PDT 2007


Sean Kelly wrote:
> kris wrote:
>> 6) the result is a library with many more duplicate symbols than 
>> before, but arranged in such a manner that persuades the linker to do 
>> the "right thing" ?
> 
> Yes.
> 
>> 7) there is no possibility of the linker following a 'bad chain', and 
>> thus linking in unused or otherwise redundant code ?
> 
> It certainly seems that way.  We get larger object files and libraries 
> in exchange for smaller executables.  If any of the above is wrong, 
> someone please correct me.

That agrees with my experience, although I'm not sure about the "smaller executables" part.  I think the reason why we 
sometimes get larger executables is more incidental than deliberate - so it doesn't always work out that way.  But if we 
opt for larger object files, then yes, we *always* get the smallest executable size as a result.

A nice thing to add to DMD for all this would be to emit "fat .obj files" when -c is supplied, no matter how many .d 
files are passed on the command line.  That way, the optimizations Walter has added (non-duplication of templates and 
typeinfo) will still become useful for direct-to-link situations (w/o -c).

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list