Executable size affected by module count?

kris foo at bar.com
Wed Jan 24 16:46:38 PST 2007


Walter Bright wrote:
> 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. 

Forgive me. They were chosen to cause the least amount of conflict? But, 
as far as OptLink goes -- yes, I have no clue about it, and there's more 
switches than a power-station. Best to ask the expert, it would seem?


> 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.

Thank you. Indeed they are. We've both been using these kinds of tools 
for approximately the same period of time.

> 
>> 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. 

Did that first. There's nothing that jumps out. I should note that this 
was first noticed perhaps two years ago ... it's not something that 
suddenly changed.

But, it has become more important recently; vis-a-vis win32 headers


> 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.

Yes, classic stuff! That's why I'm asking the expert.

> 
>> 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.

Thanks. This means it's not exactly feasible to check the concern via 
another linker.



More information about the Digitalmars-d mailing list