httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Costello <timcoste...@ozemail.com.au>
Subject Re: DLL Base addresses (was: .dsp link options)
Date Thu, 01 Jan 1970 00:00:00 GMT
On Tue, 18 Apr 2000, Greg Stein wrote:
> Euh... those conflicts are only for within an particular .exe address
> space. Apache DLLs are not going to conflict with Office97 -- they never
> get loaded into an Office process.

Agreed. The LISTDLLS tool from SysInternals (http://www.sysinternals.com/listdlls.htm) provides
useful output. So the question remains, why 0x27800000? 

> > I'll toss together a simple .dll scanner that pulls nothing but the
> > reloc base/length from all the dll's on a machine a reports the used
> > and available pages (they must be on 64k boundries last time I checked).
> 
> Extra work. Not needed.

It's probably still a good idea to rebase though - especially because we have two processes
running (with the current WinNT MPM). From the Platform SDK (http://msdn.microsoft.com/isapi/msdnlib2.idc?theURL=/library/psdk/tools/perfutil_2z39.htm):

"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.
"

and

"...[on NT/x86] the system DLLs are currently based in memory from 0x70000000 to 0x78000000..."

Benefits of rebasing are given in http://msdn.microsoft.com/isapi/msdnlib2.idc?theURL=/library/techart/msdn_pagetest.htm.


I get a bad feeling from the fact that base addresses in all the project files are now hard-coded,
because it seems like either quite a maintenance effort or the sort of thing that will be
overlooked in time. I've been using the following patch for a little while to rebase all Apache
DLLs after compilation using EDITBIN - it calculates new addresses automatically given a ceiling
address, currently set to 0x70000000. 

Tim

===== START PATCH =====

diff -r -N -u /srclib/repos/apache/2.0/src/src/Makefile.win src/Makefile.win
--- /srclib/repos/apache/2.0/src/src/Makefile.win	Thu Apr 06 08:25:05 2000
+++ src/Makefile.win	Mon Apr 17 10:09:50 2000
@@ -16,6 +16,8 @@
 #
 # Note: this does *NOT* change the compiled in default "server root"
 
+TOP_DLL_LOCATION=0x70000000
+
 !IF "$(INSTDIR)" == ""
 INSTDIR=\Apache
 !MESSAGE Using default install directory \Apache
@@ -87,6 +89,26 @@
 #       cd modules\proxy
 #        nmake /nologo CFG="ApacheModuleProxy - Win32 $(LONG)" -f ApacheModuleProxy.mak
 #       cd ..\..
+
+# Rebase DLLs
+!IF "$(LONG)" == "Release"
+!MESSAGE Rebasing DLLs from $(TOP_DLL_LOCATION) down.
+    editbin /REBASE:DOWN,BASE=$(TOP_DLL_LOCATION) \
+        Core$(SHORT)\ApacheCore.dll lib\apr\$(LONG)\aprlib.dll \
+        os\win32\ApacheModuleStatus$(SHORT)\ApacheModuleStatus.dll \
+#        os\win32\ApacheModuleInfo$(SHORT)\ApacheModuleInfo.dll \
+        os\win32\ApacheModuleAuthAnon$(SHORT)\ApacheModuleAuthAnon.dll \
+        os\win32\ApacheModuleDigest$(SHORT)\ApacheModuleDigest.dll \
+        os\win32\ApacheModuleCERNMeta$(SHORT)\ApacheModuleCERNMeta.dll \
+        os\win32\ApacheModuleExpires$(SHORT)\ApacheModuleExpires.dll \
+        os\win32\ApacheModuleHeaders$(SHORT)\ApacheModuleHeaders.dll \
+        os\win32\ApacheModuleRewrite$(SHORT)\ApacheModuleRewrite.dll \
+        os\win32\ApacheModuleSpeling$(SHORT)\ApacheModuleSpeling.dll \
+        os\win32\ApacheModuleUserTrack$(SHORT)\ApacheModuleUserTrack.dll \
+#        modules\proxy\$(LONG)\ApacheModuleProxy.dll
+        > NUL
+!ENDIF 
+
 
 _install:
 	-mkdir $(INSTDIR)

===== END PATCH =====
This message was sent through MyMail http://www.mymail.com.au



Mime
View raw message