Executable size affected by module count?
Walter Bright
newshound at digitalmars.com
Wed Jan 24 15:27:40 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.
The words used suggested an unfamiliarity with the tools. I believe it's
well worth the effort to master what's going on with object files and
linking, especially for professional developers, and the tools obj2asm,
/MAP, and dumpexe are marvelous aids.
> Do you think you could comment on why it might be the linker? And how to
> compensate? You're probably one of the two ppl in the world who know
> OptLink ...
I'd first look at the contents of the .obj file, and see if that is what
is expected. I'd also check the optlink instructions
http://www.digitalmars.com/ctg/ctgLinkSwitches.html#alignment
as there are quite a lot of switches that offer a great deal of control
over the linking process.
> Also: are dmd obj files compatible with any other linker?
Any linker that supports the Microsoft OMF format. I know Microsoft
linkers dropped support for it when they went to 32 bits, but I am not
very familiar with other linkers. Pharlap did, but I think they went out
of business.
More information about the Digitalmars-d
mailing list