Lib change leads to larger executables

Daniel Keep daniel.keep.lists at gmail.com
Fri Feb 23 15:12:47 PST 2007



jcc7 wrote:
> == Quote from Daniel Keep (daniel.keep.lists at gmail.com)'s article
>> ...
>>
>> So, why not make a small modification to OPTLINK such that if a
>> switch is thrown, and it encounters any missing symbol of the form
>> /_D11TypeInfo_.*/, then it will link only the segment that symbol is
>> in.  In other words, it does what it currently does in all cases
>> except where there's a TypeInfo involved; in which case it links
>> *just* the TypeInfo, not the whole object file.
>>
>> ...
> 
> I don't know enough about how linkers work to know if OPTLINK can just include a
> TypeInfo segment like that, but it sounds like a good idea to me. I think it's
> more feasible than my idea was (since Frits helped me see some serious challenges
> with my idea).
> 
> And if it works, it should directly address Kris's problem.
> 
> jcc7

I had a peek at the TypeInfos that are hard-coded into Phobos.  They do
import other stuff, but that "other stuff" is all in Phobos.  Since
(ignoring Tango for the moment) all D programs include at least one
non-TypeInfo symbol (the *real* main(), if I'm not mistaken), then
Phobos will always be linked in.

I think it's also safe to assume that since all other TypeInfos are
generated by the compiler, it's not going to start inserting imports to
modules all over the shop; at worst, it will import some other modules
from Phobos.

So, assuming all my assumptions hold (starts plastering his argument
with duct tape), then it should be feasible.

Of course, when it comes down to it, Walter's the expert.  What say ye?

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d mailing list