Problem with dlsym
Problem with dlsym
- Subject: Problem with dlsym
- From: "J. Davison de St. Germain" <email@hidden>
- Date: Thu, 12 May 2005 14:58:50 -0600 (MDT)
We have been using the 'dlcompat' library on OSX for a while and it
worked great. However, with Tiger 10.4, it appears that the dl
functions (eg: dlsym) are now built in. Unfortunately, when we try to
find a non-existent symbol in one of our large shared libraries, it
now takes forever (instead of returning null fairly
quickly/immediately). After about 20 minutes of 'working' on the
dlsym call, our program will return and say that it couldn't find the
symbol. When we used dlcompat before, we didn't have this problem.
We have read the man page and tried all the different options that are
presented, but nothing seems to help.
(Note, if we try the same lookup of a non-existent symbol on a
system library, it returns very quickly. The library that we are
searching is part of a large framework of other libraries and (apparently)
for some reason loads all of the other libraries in its search for the
symbol. This does seem strange as we specify the exact dylib that we
want to searh through.)
In a last ditch effort, we tried compiling and using the original
'dlcompat' libraries. Unfortunately, the compilation (using gcc 4.0)
died on the #pragma CALL_ON_LOAD dlcompat_init_func. We commented
this line out and the compilation succeeded. However, when we go to
link against the libdl.dylib that is produced, we get this warning:
symbol _dlsym used from dynamic library /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/../../../libSystem.dylib(dyldAPIsInLibSystem.o) not from earlier dynamic \
library /usr/local/SCIRun/Thirdparty/1.24.1/Darwin/gcc-4.0-32bit/lib/libdl.1.dylib(dlfcn.o)
I haven't been able to find a way to force the compiler/linker to use
the dlsym symbol from our library.
Do you have any thoughts on what is going wrong or how we could go
about fixing this?
Any help on this will be very much appreciated.
Sincerely,
J. Davison de St. Germain
-----------------------------------------------------------------------
- J. Davison de St. Germain email@hidden (801) 581-4078 -
- Chief Software Engineer http://www.cs.utah.edu/~dav -
- SCI Institute, SE C-SAFE University of Utah -
-----------------------------------------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden