Systems programming

Pragma ericanderton at yahoo.removeme.com
Fri Sep 15 14:04:49 PDT 2006


Andreas Kochenburger wrote:
> "clayasaurus" <clayasaurus at gmail.com> schrieb im Newsbeitrag 
> news:eecf69$1p6n$1 at digitaldaemon.com...
>> The smallest exe size I got on win with dmd v.166 is 65 KB using
>>
>> ---
>> int main()
>> {
>>   return 0;
>> }
> 
> I would guess this is due to some statical linkage.
> In theory the exe should not be larger than a few k, depending on the PE 
> header structure, but I am no expert in that.
> Andreas 
> 
> 

You'd be correct in that guess.  Near as I can tell, nobody has tried 
unpacking the rudimentary libs that DMD (windows) tends to link in: 
phobos.lib and snn.lib.

I bet that if you unpack those lib files, and feed only the .obj files 
needed to the linker, you'd end up with a smaller program.  Either that, 
or there's a design flaw in the D runtime that pulls in a *lot* of 
un-needed code.

(I seem to recall a debate between Walter and Kris on that very topic a 
while back... I think printf could be the culprit.)

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d-learn mailing list