Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to strip off symbols

Tags:

Last week I released the Linux and windows version of an application.

And after the release we realized that the symbols were not stripped off, and my manager thinks (and I disagree) that it might allow the user to understand our algorithm.

Anyway, now, I will have to clean-up the symbols and re-release the application.

My question,

  1. What is the best way to strip symbols in Linux?
  2. What is the best way to strip symbols in Windows?
like image 753
Alphaneo Avatar asked Apr 22 '11 00:04

Alphaneo


People also ask

How do I strip binary debug symbols?

To remove debugging symbols from a binary (which must be an a. out or ELF binary), run strip --strip-debug filename. Wildcards can be used to treat multiple files (use something like strip --strip-debug $LFS/tools/bin/*).

What is the strip command?

The strip command reduces the size of XCOFF object files. The strip command optionally removes the line number information, relocation information, the debug section, the typchk section, the comment section, file headers, and all or part of the symbol table from the XCOFF object files.

How do I strip a shell script?

--strip-symbol=symbolname Remove symbol symbolname from the source file. This option may be given more than once, and may be combined with other strip options, except -K.

How do I strip ELF files in Linux?

Using the -R option to strip, you can strip away all sections you don't need. Also look at this regarding minimal ELF executables. Show activity on this post.


1 Answers

With Visual C++ (and other Microsoft compilers) on Windows, symbols aren't part of the binaries. Instead, they are stored in separate files called "Program Database" files (.pdb files). Just don't provide the .pdb files.

With the GNU toolchain you would use strip to remove symbols from the binaries.

like image 137
James McNellis Avatar answered Sep 22 '22 05:09

James McNellis