I was wondering whether for DLL's it is better to specify a base address of 10000000h, that seems to be where they end up anyway and if you specify this at assembly then there should logically be less time used relocating at run-time. Anybody ever use the /base switch with link ?

/BASE:{address|@filename,key}

I'm assuming that it would be

/BASE:268435456

but what is the filename,key ?

I'm wondering how to set it up. I realize that they should be alligned on 4K boundaries so I was thinking that if I had several DLL's I could save load time by specifying a different base address for each and avoiding alot of relocating.
Posted on 2003-05-06 21:52:23 by donkey
http://msdn.microsoft.com/library/en-us/vccore/html/_core_.2f.base.asp
The filename, key specifies a line in a text file that contains the base address for all DLLs you compile. See the link above. The rebase utility documentation has some suggested base addresses:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/tools/rebase.asp


The system DLLs are currently based in memory from 0x70000000 to 0x78000000
(0x68000000 to 0x78000000 on MIPS). Therefore, you should base your DLLs
from 0x60000000 to 0x68000000. One possible scheme is to choose a base
address based on the first letter of the DLL name.

First letter Base address
A - C 0x60000000
D - F 0x61000000
G - I 0x62000000
J - L 0x63000000
M - O 0x64000000
P - R 0x65000000
S - U 0x66000000
V - X 0x67000000
Y - Z 0x68000000


Thomas
Posted on 2003-05-07 03:28:11 by Thomas
Thanks Thomas,

Those articles answer my questions. Yes there is a performance gain to be had. And I guess I should have figured out that link sets the address at 10000000h by default so it would be better to use a different set of addresses.
Posted on 2003-05-07 07:26:31 by donkey