Re: Re-basing packages
- From: Arthur Hoornweg <antispam.hoornweg@xxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 19:49:03 +0200
Matthew Jones wrote:
I've just got round to trying the SysInternals Process Explorer, and one option it has is to show relocated DLLs. Relocating a DLL is apparently something that will slow loading down. So I checked out my Delphi 7 running exe and pretty much every bpl file is relocated.
Has anyone done any research into how to "re-base" them for efficiency?
Yes.
If dll's/bpl's must be relocated in memory this not only slows
the machine down, it also prevents these relocated dll's to be
shared in physical memory by multiple applications thus wasting
memory.
First of all, you shouldn't re-base any Borland-supplied packages
because (a) the Eula forbids deployment of modified Borland packages
and (b) they have been compiled with correct imagebases anyway.
Apart from that:
The microsoft platform SDK has a nice tool called "rebase.exe" that will do
exactly as you want. It can even do an automatic batch rebase so that all
dll's/bpl's will neatly fit together in memory.
This is how I do it:
- I copy all DLL's and BPL's from the application into one directory,
e.g. d:\mydir.
- I create a text file (mylist.txt) that contains the names of these
DLL's in the sequence in which I want them to fit into memory.
- I write a batch file that calls the rebase utility, specifiying the text
file as an inputfile, and the desired start address:
rebase -b 0x44000000 -e 0x10000 -R "d:\mydir" -G mylist.txt
rebase -s -b 0x44000000 -e 0x10000 -R "d:\mydir" -G filelist.txt >"d:\output.txt"
This will re-base the dll's starting from address $44000000, leaving $10000
bytes free between each DLL (for future growth) and produces a list with
the start addresses so that I can use these to specify the $imagebase in
my source code.
--
Arthur Hoornweg
(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)
.
- Follow-Ups:
- Re: Re-basing packages
- From: Matthew Jones
- Re: Re-basing packages
- References:
- Re-basing packages
- From: Matthew Jones
- Re-basing packages
- Prev by Date: Re: What this mean for Borland?
- Next by Date: Allen Bauer interview in Bitwise
- Previous by thread: Re-basing packages
- Next by thread: Re: Re-basing packages
- Index(es):
Relevant Pages
|
|