linux - GNU linker: alternative to --version-script to list exported symbols at the command line? -


On Linux with GNU Toolchain, I know how to control exported symbols with a Export Script (GCC-WL) from a shared library. , - version-script = symbol.map), but I want to list the symbols exported on the command line instead. IOW, I want to equate

  link / export: foo  

with MS toolchain. Is it possible?

Edit:

My question may not be very clear: if I have a library libfoo.so, and I only want to export foo1 and foo2 libraries, I I can make a version script foo.linux as follows

  libfoo.so {global: foo1; Foo2; Local: *; }  

and do

  gcc -shared foo.c -wl, - version-script = foo.linux -o libfoo.so -ssoname libfoo. So  

I want to be able to do something like this instead:

  gcc -shared foo.c -wl, - export-symbol = Foo1 - Wl, - export-symbol = foo2 -o libfoo.so-gold libfoo.so  

I'm not sure you can do it as you want. In a way the linker version is with the script as you mentioned. Another way is to add your source code __attribute__ ((visibility ("default")) for anything you want to export and compress everything together - hidden


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -