Solved

DLL/DPL: How to choose imagebase?

Posted on 2001-07-20
3
811 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
Comment Utility
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
Comment Utility
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
Comment Utility
And here are your points since nobody else cared to add any comment.

Thanks,
F.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now