title: having object file symbols become dynamic symbols in executable
body: <p>I have several object files (from C++) that are spat out of a build system. They have several <code>extern "C"</code>-linkage symbols I want to use in a program and have accessible via <code>dlopen</code>/<code>dlsym</code> from elsewhere.</p>
  
  <p>When compiled into an executable with gcc, these symbols are not listed using <code>nm -D &lt;executable-here&gt;</code> (i.e. afaik they're not dynamic symbols).</p>
  
  <p>How do I get them to become exposed as dynamic symbols within the compiled executable?</p>
  
  <p>I can change the build flags for the object files and for the executable, but changing how the C++ files end up in the final executable (i.e. not making them into object files first) is difficult.</p>
  
  <p>(GCC 4.8, ld 2.24)</p>
  
  <p>EDIT: I came across this question, which may or may not be what I'm asking, but I'm not entirely sure.
  <a href="https://stackoverflow.com/questions/14289488/use-dlsym-on-a-static-binary?rq=1">Use dlsym on a static binary</a></p>