Re: /DELAYLOAD Linux counterpart for shared objects
- From: perfry@xxxxxxxxx
- Date: Mon, 23 Jun 2008 02:28:51 -0700 (PDT)
On 23 Juni, 03:58, John Reiser <jrei...@xxxxxxxxxxxx> wrote:
per...@xxxxxxxxx wrote:For brevity, I did not give the whole story. The shared object in
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.
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.
Here is what I understand: Dlsym returns a function pointer, which can
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.
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
.
- Follow-Ups:
- Re: /DELAYLOAD Linux counterpart for shared objects
- From: David Schwartz
- Re: /DELAYLOAD Linux counterpart for shared objects
- References:
- /DELAYLOAD Linux counterpart for shared objects
- From: perfry
- Re: /DELAYLOAD Linux counterpart for shared objects
- From: John Reiser
- /DELAYLOAD Linux counterpart for shared objects
- Prev by Date: Re: /DELAYLOAD Linux counterpart for shared objects
- Next by Date: Re: /DELAYLOAD Linux counterpart for shared objects
- Previous by thread: Re: /DELAYLOAD Linux counterpart for shared objects
- Next by thread: Re: /DELAYLOAD Linux counterpart for shared objects
- Index(es):
Relevant Pages
|