I have a library taking up a lot of disk space. Only one program I use links to that library.
I am pretty sure that the program uses only a tiny fraction of the functionality provided by that library.

Can I somehow programmatically remove functionality from the library that is not needed for running that program, so it will take up less disk space?
(Without having to recompile the library if possible)

closed as unclear what you're asking by muru, slm Aug 24 '18 at 12:41

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


No, that's not possible. Recompiling the program and linking the library statically is probably the only option. But you need to weigh the time it takes to do that against the cost of disk storage. What does a gigabyte cost nowadays? Less than the cup of coffee you'd be consuming while compiling the stuff.

Not the answer you're looking for? Browse other questions tagged or ask your own question.