Re: /DELAYLOAD Linux counterpart for shared objects
- From: perfry@xxxxxxxxx
- Date: Mon, 23 Jun 2008 07:12:36 -0700 (PDT)
On 23 Juni, 14:27, David Schwartz <dav...@xxxxxxxxxxxxx> wrote:
On Jun 23, 2:28 am, per...@xxxxxxxxx wrote:
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.
The compiler will still check the parameters, so long as you ask it
to.
For example, assume that the library contains a function called
'some_library_func'. Assume that your code will only call this
function if the library exists and the function can be resolved in it
(you need some kind of 'loader' function that fills in all the
pointers and makes sure the library is there). Your wrapper looks like
this:
int some_library_func(int foo, void *bar)
{
return my_table->some_library_func(foo, bar);
}
Thanks, David!
No solution without writing wrapper functions? I'm shuddering for
declaring a function pointer to the following example of function in
the library in question:
sword OCIEnvNlsCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
dvoid *(*malocfp)(dvoid *ctxp, size_t size),
dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t
newsize),
void (*mfreefp)(dvoid *ctxp, dvoid *memptr),
size_t xtramem_sz, dvoid **usrmempp,
ub2 charset, ub2 ncharset);
/Per
.
- Follow-Ups:
- Re: /DELAYLOAD Linux counterpart for shared objects
- From: Jens Thoms Toerring
- 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
- Re: /DELAYLOAD Linux counterpart for shared objects
- From: perfry
- Re: /DELAYLOAD Linux counterpart for shared objects
- From: David Schwartz
- /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
|