Solved

DLL/DPL: How to choose imagebase?

Posted on 2001-07-20
3
813 Views
Last Modified: 2008-02-01
It's about the imagebase linker param that defaults to $00400000.

For DLL's and DPL's I understand it's recommended to change it, in order to minimize load time and eventually memory consumption.

1. First of all, has anybody any experience about the efectiveness of changing this setting?
2. Can you suggest any policy for choosing the value?
3. Any potential problems when several apps are using the same DLL because it was loaded at its preferred address?
4. How do you manage the settings for different DLL's across all your pool of own-developed libraries? What about "collision" chances with other libraries already in the target system?

Thank you,
F.
0
Comment
Question by:fva
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 100 total points
ID: 6303276
Hi F.

1.) Unless the app uses a large number of dll's, this has little affect, and then only on the load time.

2.) Per MSDN:

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

It is best to base DLLs from the top of the address range down, instead of from the bottom up. Dynamic memory is allocated from the bottom up and if a DLL tries to load where dynamic memory has been allocated, it will be relocated, just as if a DLL was loaded at that address.

3.) No.

4.) Not sure if I follow the question, but windows will rebase the dll in memory if the image base address is in conflict. Answer 2 (above) covers the addresses for system dll's.

Russell



0
 
LVL 4

Author Comment

by:fva
ID: 6308172
Hi, thanks.

I admit, 4) it's actually a rephrase of 2)

I'll let some time open this, maybe I get other opinions, too.

F.
0
 
LVL 4

Author Comment

by:fva
ID: 6326229
And here are your points since nobody else cared to add any comment.

Thanks,
F.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question