user1797612 user1797612 - 1 month ago 4
C++ Question

Is it safe to strip a shared library after linking?

Let's suppose that I got
, I compile the binary
and I link this to

At this point, considering that everything is working as expected, It's safe or not to take
and strip it with
strip -s

To be clear I'm not interested on linking other binaries to my
is properly generated, I'm only interested on keep
working and gain some disk space and maybe a small edge in terms of performances.


Yes, it's safe. strip only removes symbols that are not needed (because they have already been linked). Those symbols are useful for debugging, but they are never needed just for executing the code.