This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Cygwin 64 bit?


On 7/8/2011 2:06 PM, Corinna Vinschen wrote:
> On Jul  8 13:52, Earnie wrote:
>> Well, shouldn't libtool search LD_LIBRARY_PATH as well as PATH for the
>> DLL for Cygwin?  Why should it be that much different than Linux where
>> the shared libraries are never in bin/?
> 
> Something else I'm wondering about is this.
> 
> Right now the executable contains just the name of a DLL it is linked
> against.  Does the PE/COFF format allow to store a relative path in the
> executable?  Something like, say,  "..\\lib64\\libfoo.dll"?  If that is
> possible (I have really no idea) wouldn't that allow to have the DLLs
> in /usr/lib64, given that /usr/bin is in $PATH anyway?

FYI, interesting (but old) article...
"What Goes On Inside Windows 2000: Solving the Mysteries of the Loader"
http://msdn.microsoft.com/en-us/magazine/cc301727.aspx

LoadLibraryEx[W] (which according to the article above is used, under
the hood, by all the various dll loading pathways)
http://msdn.microsoft.com/en-us/library/ms684179%28v=vs.85%29.aspx

About the name parameters, it says "If the string specifies module name
without a path or with a relative path, the function uses a standard
search strategy to find the module;"

and

"If a relative path is used, the entire relative path is appended to
every token in the DLL search path list. To load a module from a
relative path without searching any other path, use GetFullPathName to
get a nonrelative path and call LoadLibraryEx with the nonrelative path.
If the module is being loaded as a datafile and the relative path that
starts with .\ or ..\, the relative path is treated as an absolute path."


The real question is, I suppose, what does the Runtime Loader /do/
before it finally calls LoadLibraryEx[W], when presented with a relative
pathname in an EXE's import table? (Or better still, what does ld.exe
do, when linking against an import library that specifies a relative
pathname -- that is, how to you embed a relative pathname INTO the exe's
import table in the first place?)

--
Chuck


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]