Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: randyhyde@xxxxxxxxxxxxx
- Date: 15 Apr 2005 09:42:18 -0700
Beth wrote:
>
> This sounds more like a kind of "aliasing" thing than "lazy
binding"...
Okay, different concepts, then. Sorry, I've not been paying *real*
close attention to what's being said in this thread.
>
> "Lazy binding", in Linux, happens at _run-time_ and is simply a case
of
> handling the "dynamic linking" process on a "per call" basis, when
that
> call is actually made...
Isn't that just "load on demand"? Again, I'm not an expert on Win32
DLLs, but I was under the impression that they provided a facility to
link a pointer to a stub routine that would load a DLL on demand and
patch the pointer thereafter (i.e., dynamic linking). Is this what
you're looking for?
>
> You know, when Windows loads a DLL, it sorts out all the "dynamic
linking"
> there and then during load-time...with "lazy binding", this is
delayed
> until the symbol is _actually_ called (which potentially means that
if the
> code in the library is never referenced at run-time - say, a library
is
> only accessed when the user chooses some menu option to run a
specific
> function that uses that library (and no other part of the code uses
it),
True, but I was under the impression that Windows provides a facility
to load the DLL when you first call the function in question. Does such
a facility not exist?
>
> Ah, the names sound similar but "lazy binding" and "weak externals"
aren't
> actually the same thing in this case..."weak externals" is a kind of
> "alias" mechanism (useful, as you mention, for, say, being able to
> alternatively link in some "integer only" library that "emulates"
> replacements for floating-point routines in a floating-point
> library...using an "aliasing" kind of mechanism)...while "lazy
binding" -
> at regard Linux and LD, anyway - refers to an alternative method of
"late
> linking"...
Well, weak externals is slightly more than that, but you're essentially
correct here.
>
> Actually, looking through the PE file format document, there _IS_
something
> slightly similar called a "Delay-load Import Table"...this delays
actually
> loading a DLL until one of its functions are actually called...now,
_THAT_
> corresponds to the "lazy binding" that LD provides by default...
That's what I remember reading about (see above comments).
>
> Well, okay, Windows appears that it does have it...but LD does this
"lazy"
> thing by default, while, with Windows...well, does anyone out there
know
> how you get a DLL into the "delay-load import table" instead of the
usual
> plain old "import table"? Windows _can_ do it - I sit corrected -
but,
> well, goodness knows _HOW_ you get LINK.EXE to set this up for you
:)...
Don't ask me. But the MS-Link manual is on-line on Webster. OTOH, it
didn't have a whole lot to say about weak externals...
>
> Anyway, before I end, I've got to get the bad joke in, haven't I?
>
> "You are the weakest link...goodbye!"
Arrggh!
Cheers,
Randy Hyde
.
- Follow-Ups:
- References:
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: T.M. Sommers
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: Frank Kotler
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: T.M. Sommers
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: Beth
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: Randall Hyde
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- From: Beth
- Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- Prev by Date: Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- Next by Date: Re: The wonderfull "Success Story" of HLA.
- Previous by thread: Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- Next by thread: Re: Linux, X, ld, gcc, linking, shared libraries and stuff
- Index(es):
Relevant Pages
|