Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DLL/DPL: How to choose imagebase?

Posted on 2001-07-20
3
Medium Priority
?
835 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 400 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

916 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