Reputation: 429
I am building a simple library in C and compiling it with gcc
gcc -c lib.c -o lib.o
gcc -shared -o lib.so lib.o
If I inspect the shared object with objdump or xxd, the following appears:
GCC: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Is there an option to exclude this information?
Upvotes: 1
Views: 32
Reputation: 60068
You can remove it after the fact with objcopy:
$ objcopy --remove-section .comment lib.so
Upvotes: 1