title: Strip debug info from linux shared library
body: <p>I’m using GCC to compile a shared library for ARM Linux. Here’s my compiler options from CMakeLists.txt:</p>
  
  <pre><code>add_definitions( "-std=c++14 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wno-psabi -march=native -mfpu=neon" )
  </code></pre>
  
  <p>I’ve just opened the resulting .so file in a disassembler. I was disappointed to see a lot of stuff there. It showed me names for everything, including all my internal classes, and functions that were never exported. Even the stuff from anonymous namespaces is still there. On the “Exports” tab on the disassembler, I only see a dozen of functions I actually export (plus just a few extra: <code>.init_proc</code> <code>.term_proc</code> <code>_edata</code> <code>__bss_end__</code> and <code>call_weak_fn</code>).</p>
  
  <p>On Windows, I only see these things if I have a PDB file for the module I’m disassembling. But I don’t ship my .PDB files.</p>
  
  <p>I’d like the same behavior for GCC.</p>
  
  <p>Is there a way to tell GCC to stop including that debug info (=the mangled name of each and every function) in the .so file, and actually compile these things into binary addresses?</p>