|
From: Soren A. <so...@wo...> - 2000-12-12 21:36:55
|
Hello List-MinGW,
Through many trials and errors I've been learning about making DLLs
using MinGW and I've focused on software (typically gnu or similarly-
licensed Open Source software written in C) that comprises part of a
typical Linux installation (libjpeg, libpng, etc.) My OS is WinNT4.
Can readers explain to me please about strategies for dealing with image
basing of relocatable DLLs? I understand that there is a default base
address that, absent the user giving another to gcc explicitly, will be used
at DLL-making time. If one builds multiple libs and all use that same base
address, I think the OS has to relocate the DLL when it's called by a
linked application, to another free address, if the given base is already
"occupied"? If so, does this slow down the loading and execution of the
object code needed in the DLL? If so, how much; and are there any other
side-effects (penalties) of this extra relocation step?
If the above describes something that IS a concern -- and I believe it is,
for reasons that aren't rigorous but more of a guess and a surmise based
on trying to grasp what I've read here and around in the past -- then
how do users on this List (the "experts") go about telling gcc what to use
for a base address? Specifically, starting at the default or user-set base
address, what determined how high into the memory addresses
(counting upwards) the DLL loads? Is there a consistent predictable
relationship between the size of the DLL executable object file on disk (in
bytes) and the amount of memory required to load it -- a one-to-one
correspondence? Is there any additional margin or overhead, perhaps?
The reason I ask is that I have been looking at the source for X11R6.4
and I see what the bright folks at Cygwin did to port various pieces of X
to win32. In one Imake Makefile there is some code that accesses a
temporary "counter" file on the local filesystem (in /tmp) and uses
whatever is in there as the starting point for setting the base address.
There's some very fancy shell scripting going on that instance (in that
Makefile), however, and I didn't understand entirely the syntax and flow
of what i was seeing -- just took it as a vague clue. And the comments to
the code say that they are building every DLL in the X global package
based to a different, unique address. So clearly they think it important.
Thanks for any help you can give me,
soren andersen
P.S. Is anyone on this List actually running a minGW-built X on a win32
system? If so, what X window manager do you prefer? <- slightly OT
-
"Everything that I've learned about computers at MIT I have boiled down into three principles:
- Unix: You think it won't work, but if you find the right wizard, he can make it work.
- Macintosh: You think it will work, but it won't.
- PC/Windows: You think it won't work, and it won't."
-- Philip Greenspun
|