I'm using a program that uses libltdl (from libtool) to wrap calls to dlopen (e.g. lt_dlopenext) and dlsym and it is utterly unable to dlopen "standard" shared libraries.
Gentoo (probably following upstream glibc) has been putting linker scripts where shared libraries were orignially expected. ``` $ cat /usr/lib64/libm.so /* GNU ld script */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libm.so.6 AS_NEEDED ( /lib64/libmvec.so.1 ) ) ``` So a call to lt_dlopenext("libm"), with ltdl compiled with -DLT_DEBUG_LOADERS, produces output like this (but lt_dlerror only reports "File not found") ``` try_dlopen (libm, .la) tryall_dlopen (libm.a, lt_preopen) Calling lt_preopen->module_open (libm.a) Result: Failed Error message << file not found >> try_dlopen (libm, .so) tryall_dlopen (libm.a, lt_preopen) Calling lt_preopen->module_open (libm.a) Result: Failed Error message << file not found >> tryall_dlopen (/usr/lib64/libm.so, (ALL)) Calling lt_dlopen->module_open (/usr/lib64/libm.so) Result: Failed Error message << /usr/lib64/libm.so: invalid ELF header >> Calling lt_preopen->module_open (/usr/lib64/libm.so) Result: Failed Error message << file not found >> ``` Only a call to lt_dlopen with the full path "/lib64/libm.so.6" would work. But the library I'm using only exposes lt_dlopenext. Perhaps ltdl should parse the linker scripts and dlopen the real dll? --- Regards, Madhu