title: How to keep a specific symbol in binary file?
body: <p>I have a static lib (<code>my_static_lib</code>) which I link to an executable binary file. Some of the symbols, but not all, are used in my binary.</p>
  
  <p>A second library, dynamically loaded(<code>my_shared_lib</code>), is expecting to receive some symbols from my_static_lib through symbol injection from the binary. But those symbols are not used by my_binary, so they are stripped off the final bin file. </p>
  
  <p>So, at runtime, <code>my_shared_lib</code> complains that it cannot find <code>__my_stripped_symbols__</code> and crashes.</p>
  
  <p>Is there a way to force the linker to keep <code>__my_stripped_symbols__</code>? I would prefer something that can be cleanly written in a Makefile.am (autotools)</p>
  
  <pre><code>(-binary file makefile)
  -L$(top_builddir)/static_lib -lmy_static_lib --magic-flag-to-keep-stripped-symbol
  </code></pre>
  
  <p>I do not want to link <code>my_static_lib</code> with <code>my_shared_lib</code> because it will generate strange conflicts in other parts of a rather complex group of executables/shared libraries.</p>