building shared libraries

Andres Gonzalez gonzo at agoralabs.com
Wed Jan 2 17:42:28 MST 2008


I am porting a DLL (originally developed for MS Windows) to linux and
I have a couple of basic questions about shared libraries in linux.

How do you control what symbols and function names are exported or
available when building the shared library?

My code is compiling fine (using position independent code) and I am
producing the .so file. When I run nm on the .so file, it shows tons
and tons of symbols. My function names are also mangled. I want to
only have a few select API functions available public ally.

Do I use strip and strip out all of the private symbols thus leaving
only the symbols I want public?

How do I unmangle the function names?  I cannot get an application to
link with my newly created shared library because the function names
are all mangled in the shared library. So how do I "export" my API
function names?

I am looking for the linux equivalent of the MS Windows
_declspec(dllexport)

Thanks for any help and direction...

-Andres





More information about the PLUG mailing list