title: Why does my executable's .dynstr contain symbols from statically linked libraries?
body: <p>I'm building a C++ executable. I'm statically linking several of the C and C++ libraries I'm using, including a custom one. (I am not, however, statically linking every library I'm using.)</p>
  
  <p>Even taking that into account, the executable seemed abnormally large. I used <code>objdump -h</code>, which told me that I was using far more space in <code>.dynstr</code> than I expected. I've compiled with <code>-Os</code> and run <code>strip</code>, but when I run</p>
  
  <pre><code>$ readelf -p .dynstr slamshift
  </code></pre>
  
  <p>I get many entries like</p>
  
  <pre><code>  [ 13588]  _ZN3yuu6windowC2Ev
    [ 1359b]  _ZTSN3yuu7gfx_ctxE
    [ 135ae]  _ZN4YAML7Scanner11ScanFlowEndEv
    [ 135ce]  __glewVertexFormatNV
  </code></pre>
  
  <p>for symbols in the libraries I've statically linked (my own library, yaml-cpp, and GLEW).</p>
  
  <p>Why are these symbols appearing in my executable? If I've statically linked the libraries involved, shouldn't the symbol names be unnecessary?</p>
  
  <p>I am using Ubuntu 12.04, GCC 4.6.3, and CMake and its default settings to build, if those are relevant.</p>