M
maven22
Hello,
I wrote a little app which uses a shared library (DLL). Normally, I
load the shlib using "dlopen()", and find the functions I want using
"dlsym()". However, I am attempting to get rid of any overhead and am
curious about a little problem I'm having.
I decided to make a function in my shlib called
"get_function_list()". When I start my program, I open the shlib
using "dlopen()" and use "dlsym()" to get the "get_function_list()"
function. That function returns a list of all the methods inside the
shlib that I will be using.
Therein lies the problem. For any function in my shlib, the address
returned by dlsym() and the address returned in my function list are
different. I've placed a bunch of debug code in both my shlib and my
sample app to printf the address of the function. Using dlsym(), the
function I want is located at "0x2405e0e8", but the address in my list
is "0x24032e38". Unfortunately, the difference between dlsym and my
list is not always 2b2b0 as in this case.
Has anyone ever experienced this or does anyone have any insight in to
the issue?
Any help will be greatly appreciated.
Thanks!
I wrote a little app which uses a shared library (DLL). Normally, I
load the shlib using "dlopen()", and find the functions I want using
"dlsym()". However, I am attempting to get rid of any overhead and am
curious about a little problem I'm having.
I decided to make a function in my shlib called
"get_function_list()". When I start my program, I open the shlib
using "dlopen()" and use "dlsym()" to get the "get_function_list()"
function. That function returns a list of all the methods inside the
shlib that I will be using.
Therein lies the problem. For any function in my shlib, the address
returned by dlsym() and the address returned in my function list are
different. I've placed a bunch of debug code in both my shlib and my
sample app to printf the address of the function. Using dlsym(), the
function I want is located at "0x2405e0e8", but the address in my list
is "0x24032e38". Unfortunately, the difference between dlsym and my
list is not always 2b2b0 as in this case.
Has anyone ever experienced this or does anyone have any insight in to
the issue?
Any help will be greatly appreciated.
Thanks!