0

I am looking for ways I can reduce the size of a shared library. The problem is that my library uses external libraries created by other people, and I only use some of the functions from those libraries. My questions is this: is there a way I can strip out specific symbols from those libraries, i.e. the ones I don't need? This is one of the ways that I thought might lower the size of my library.

What other techniques can I use to decrease the size? In terms of my own code, I am exposing the functions that need to be exposed. However, I still want my libraries' size to be much smaller so I am looking for other ways to do so.

sasfour
  • 399
  • 1
  • 3
  • 10

1 Answers1

0

Unfortunately, you would need the source code of 3rd party libraries to be able to achieve your objective. There are several ways in which a binary generated by the compiler could be made to a lower size. one such way is to use the compiler switch -o when you are using gcc. https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Another important thing to note is that when you have a reduced binary size it might impact your runtime in some instances.