#578673 libtool: does not respect symbol visibility when preparing for dlpreopen

#578673#5
Date:
2010-04-21 17:16:04 UTC
From:
To:
Hi,

when statically linking a program that uses libltdl to load plugins, the
symbol tables for the plugins are compiled into the main program as a C
structure; the command used to get the symbols from the file is "nm -B".

This will list all the symbols, including hidden ones, which has two
drawbacks:

 - for libraries that were loaded as dependencies, the entire library is
   added to the executable, even if the code can never be called (this
   may be regarded as a feature, as there is no way to know whether the
   main program may choose to call a function by name, however it is
   pretty unlikely for a library that was pulled in as a dependency of a
   plugin to be called that way); this causes the entire libstdc++ and
   libc to be pulled in, resulting in multi-megabyte binaries.

 - if the plugin or library has hidden symbols, these are still included
   in the list; however linking against those fails as they are not
   accessible. This makes building statically linked programs using a
   library that uses symbol visibility fail.

   Simon