This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ld -shared -Bsymbolic and C++ shared library


ld -shared -Bsymbolic will reduce number of dynamic relocations in
a shared library. Unfortunately, it won't work correctly with C++
exception and maybe other language features.

However, I think it is possible to make -shared -Bsymbolic to work
for C++ by providing a way to specify a list of symbols which must
be dynamic. We then can do

# g++ -Wl,-Bsymbolic -shared -xxx "list of dynamic symbols" -o libfoo.so ...

and libfoo.so written in C++ will work correctly with much fewer dynamic
relocations.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]