Re: Linux, X, ld, gcc, linking, shared libraries and stuff




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

.



Relevant Pages

  • Problems installing DBD::mysql on Solaris
    ... referenced symbol not found at ... Perhaps a required shared library or dll isn't installed where expected ... Failed 2/5 tests, 60.00% okay ... t/20createdrop.....install_driverfailed: Can't load ...
    (comp.lang.perl.modules)
  • DBD::ODBC make test fails in HPUX11.11
    ... I'm trying to install DBD-ODBC 0.28 in a HPUX box. ... install_driverfailed: Can't load ... Perhaps a required shared library or dll isn't installed where expected ... Failed 13/14 tests, 7.14% okay ...
    (comp.lang.perl.modules)
  • Re: running a service/driver/application upon startup
    ... debug version of the image is too large to load onto the device. ... I ran dumpbin/exports on the finger dll and saw the required function names: ... > theories as to why it's not getting loaded but just doing 'services load ...
    (microsoft.public.windowsce.embedded)
  • Re: Unable to load custom driver on WinCE 6
    ... I'm trying to make and load a simple DLL on WinCE 6 by following the ... I've made a subproject at PB project to include the simple DLL ... At the target device, the mydriver.dll file is in the Windows ... I wrote a simple application to load the driver dynamically ...
    (microsoft.public.windowsce.embedded)
  • Re: Cannot activate sbcl
    ... but I think what happens is that Windows sees that your executable has a DATA section that might overlap a DLL's address space then it would reallocate that DLL to different address space. ... VirtualAlloc dynamically in your code is that your program and all its ... What can be done here is to have many tiny executables with different BSS sections in them, which then load a bigger executable in the form of a DLL. ...
    (comp.lang.lisp)