[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: amendment to shared library policy



Steve,
   Well I think you may need to use a combination of tools to
get all the information. It seems to me that 'ldd -d -r' is
the simpliest to use (since many folks don't like or trust
prelink yet) to find the undefined symbols. 

So for example you might find...

ldd -d -r ./libgmodule-1.2.so.0
ldd: warning: you do not have execution permission for `./libgmodule-1.2.so.0'
        libdl.so.2 => /lib/libdl.so.2 (0x6ffb9000)
        libc.so.6 => /lib/libc.so.6 (0x6fe54000)
        /lib/ld.so.1 => /lib/ld.so.1 (0x08000000)
undefined symbol: g_free        (./libgmodule-1.2.so.0)
undefined symbol: g_threads_got_initialized     (./libgmodule-1.2.so.0)
undefined symbol: g_thread_use_default_impl     (./libgmodule-1.2.so.0)
undefined symbol: g_thread_functions_for_glib_use       (./libgmodule-1.2.so.0)
undefined symbol: g_static_private_set  (./libgmodule-1.2.so.0)
undefined symbol: g_malloc      (./libgmodule-1.2.so.0)
undefined symbol: g_static_private_get  (./libgmodule-1.2.so.0)
undefined symbol: g_strconcat   (./libgmodule-1.2.so.0)
undefined symbol: g_static_mutex_get_mutex_impl (./libgmodule-1.2.so.0)
undefined symbol: g_strdup      (./libgmodule-1.2.so.0)
undefined symbol: g_log (./libgmodule-1.2.so.0)
undefined symbol: g_free        (./libgmodule-1.2.so.0)

Then you would use something like...

nm  -D libglib-1.2.so.0.0.10 | grep g_free
00016638 T g_free
000226a8 T g_string_free

..to out if that symbol is defined in a particular library (ie which
libraries really should have been linked in). I have a set of scripts
which will do this automatically (based on one Marco was using). 
I can post them here if anyone is interested...basically you pass
the script a library that 'ldd -d -r' has reported undefined symbols
for and it will spit back all the libraries which define that 
particular symbol. Of course one has to do a bit of work with that
information because sometimes more than one library will define
the same symbol. However it greatly simplifies the process.
                Jack



Reply to: