Executable size affected by module count?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed Jan 24 15:22:51 PST 2007


kris wrote:
> Walter Bright wrote:
>> kris wrote:
>>
>>> There's no real surprise that this would happen, but it's the actual 
>>> difference that is cause for a little concern -- it appears that each 
>>> module consumes 512 bytes minimum. This may actually be a linker 
>>> thing, but perhaps not?
>>
>>
>> The way to see what's in an object file is to run obj2asm on it. It'll 
>> show exactly what's submitted to the linker.
>>
> 
> I'm aware of that, thanks.
> 
> Do you think you could comment on why it might be the linker?

Suggesting you look at what's submitted to the linker doesn't 
necessarily imply the linker is the cause. If it receives object files 
with more data in it (generated by the compiler) and dutifully links 
them, the output is still bigger ;).

> Also: are dmd obj files compatible with any other linker?

IIRC OMF (the format of dmd obj files) used to be the "standard" object 
format on Windows[1], and perhaps other OSs as well. That was a while 
back though. It wouldn't surprise me if optlink is the only recent 
linker to support it, but even if so you may be able to find some old 
versions of other linkers that support it.


[1]: Or was it still DOS back then? The MS OS at the time, anyway.



More information about the Digitalmars-d mailing list