Re: /DELAYLOAD Linux counterpart for shared objects



On 23 Juni, 03:58, John Reiser <jrei...@xxxxxxxxxxxx> wrote:
per...@xxxxxxxxx wrote:
How do I construct an executable that is capable of using a shared
object when a user requests certain functions, without needing
that .so for users that don’t do such requests? The point is that
users not interested in the services offered by the particular .so
should not have to install it.

Thereby leading to disappointment when they _do_ attempt to use
those services after accumulating several hours of state that
is lost because the program did not verify the presence of
all resources at the beginning.

For brevity, I did not give the whole story. The shared object in
question contains the API of a commercial product. Some people buy
that product, install it, and configure my program for that. Other
people use another product, install and configure for that, and they
don't want to buy/install anything else.

Of course I could use dlopen(3) in my code, but then it seems I’d have
to use dlsym for maybe hundreds of functions of the .so.

No doubt you have heard of a loop that updates a transfer vector?

My ignorance is almost complete on ELF.

On windoze I
can use /DELAYLOAD and the exe starts without bothering about the dll,
until there’s a reference, and I just have to handle an
ERROR_MOD_NOT_FOUND exception on attempts to call the main entry
functions of the dll.

You can simulate the same thing with ELF .so by using a transfer vector
whose every entry begins by pointing to a "dlopen the .so" function.

Here is what I understand: Dlsym returns a function pointer, which can
be used to call the function, and I can of course collect the pointers
in an array. A big disadvantage is that the compiler, as far as I
know, won't check any parameters of the calls to the .so. I don't know
anything about the proposed ELF solution.

Best regards,
Per
.



Relevant Pages

  • Re: OT: On the subject of Kindles etc. . . .
    ... It comes with the 'Touch Book OS', ... A VoIP application may be installed by default - if one isn't, it'll be easy to install one manually. ... So there'll be room for a 3G card, and with VoIP it'll be a highly portable netbook/tablet/ebook reader and useable as a phone. ...
    (rec.arts.mystery)
  • Re: OpenBSD 3.5 & GNAT
    ... > They switched to ELF and they don't have GNAT package anymore. ... > to install old package, enabled a.out, but when I try to run gnatmake ... too painful. ...
    (comp.lang.ada)