The (1st) problem:
I have a shared library shared1.so
, which is using a static library static1.a
.
I have another shared library shared2.so
.
shared2.so
can't link directly with static1.a
due to a limitation.
I want shared2.so
to use static1.a
.
My solution
I exported static1.a
functions in shared1.so
, and now shared2.so
is using static1.a
functions by linking with shared1.so
. This is working ok!
However I ended up with all static1.a
symbols appear in shared1.so
.
The (2nd) problem
How can I get rid of all these symbols/functions that are not used by shared2.so
?
I tried:
arm-linux-androideabi-objcopy --strip-symbols symbols_of_static1_which_i_dont_use.txt shared1.so
however it doesn't do anything, no warning either (even with -v).
I also tried with arm-linux-androideabi-strip
but it doesn't strip anything too.
EDIT:
So it seems strip
only strips the static symbols and doesn't touch the .dynsym section.
I'm still looking for a way to remove all unnecessary symbols of static1.a that are now exported in shared1.so