DLL symbol identity

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Mon May 11 08:32:46 PDT 2015


On Monday, 11 May 2015 at 14:57:46 UTC, Marco Leise wrote:
>
> Is that what would happen?

Yes, that's exactly what would happen. You could go one step 
further and not do it for all symbols, instead you make the 
compiler emit a additional section with references to all 
relevant data symbols. Then you only do the patching operation on 
the data symbols and leave all other symbols as is. This would 
greatly reduce the number of symbols that require patching.

The exepcted data set size should be significantly smaller then 
on linux. Because currently on linux D simply exports all 
symbols. Which means that the linux loader does this patching for 
all symbols. On windows only symbols with the "export" protection 
level get exported. That means the set of symbols this patching 
has to be done for is a lot smaller to begin with. The additional 
optimization would reduce the number of symbols to patch once 
again. So even if the custom implementation is vastly inferior to 
what the linux loader does (which I don't think it will be) it 
still should be fast enough to not influence program startup time 
a lot.


More information about the Digitalmars-d mailing list