Hi,
for a few weeks now openSUSE Factory has a binutils which
supports -Bsymbolic-functions. This option causes global symbol references
inside a shared object to be resolved locally if that is possible, e.g. if a
shared library calls within one of its functions another exported function
that is defines itself, then that one is encoded via a local relative jump,
rather than going through the complicated and slow ELF semantics.
This does break if an application is interposing a symbol, e.g. tries to
replace one of the libraries public functions by one it defines by its own
and expects the library to call the one the application provides.
This is however rare and usually even is an unintended symbol clash.
So, whats the advantage?
of course that depends on the library type: C++ benefits a lot more than plain
C libraries.
I've tested it however successfully against small c libraries (e.g.) ncurses
or dbus-1 as well as big c++ libraries (libzypp, boost, libstdc++,qt3).
For e.g. ncurses it resulted in a 1.2% disk space saving and roughly 25%
reduced relocation time (granted, its only measurable via
LD_DEBUG=statistics). For qt3, it results in a 38% relocation time
improvement and a 5.5% disk space saving.
So, in short: if you know what you're doing, then use
$LDFLAGS=-Wl,-Bsymbolic-functions
Dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-packaging+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-packaging+help(a)opensuse.org