title: GNU linker: alternative to --version-script to list exported symbols at the command line?
body: <p>On Linux with the GNU toolchain, I know how to control exported symbols from a shared library with a version script (gcc -Wl,--version-script=symbols.map), but I would like to list exported symbols on the command line instead. IOW, I would like the equivalent of</p>
  
  <pre><code>link /EXPORT:foo 
  </code></pre>
  
  <p>from the MS toolchain. Is it possible ?</p>
  
  <p>EDIT:</p>
  
  <p>My question may not be very clearn: if I have a library libfoo.so, and I want to only export libraries foo1 and foo2, I can go create a version script foo.linux as follows</p>
  
  <pre><code>libfoo.so
  {
  global:
      foo1;
      foo2;
  local:
      *;
  }
  </code></pre>
  
  <p>And do</p>
  
  <pre><code>gcc -shared foo.c -Wl,--version-script=foo.linux -o libfoo.so -soname libfoo.so
  </code></pre>
  
  <p>I would like to be able to do something like this instead:</p>
  
  <pre><code>gcc -shared foo.c -Wl,--export-symbol=foo1 -Wl,--export-symbol=foo2 -o libfoo.so -soname libfoo.so
  </code></pre>