This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to assign which symbols/functions to export from a .so file
- From: éææ <longhaitao at otsc dot com dot cn>
- To: "Chen(é) Jun(å)" <chjfth at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 13 Dec 2007 17:35:32 +0800
- Subject: Re: How to assign which symbols/functions to export from a .so file
- References: <4760F9A2.50802@gmail.com>
Chen(é) Jun(å) åé:
Hello, everyone,
I'd like to know, when I generate a .so file with ``gcc -shared'', how
can I assign which functions to export(visible by the .so user). This
is important , because a .so author would probably like to hide his
private functions so that the private symbols will not conflict with
that of .so from other programmers.
Microsoft compiler use a .def to describe what symbols to export from a
DLL, or, __declspec(dllexport) can easily export functions of a whole
C++ class. Does the gcc world support this feature.
maybe option '-fvisibility' can answer you question.
you can search the gcc manual for more information.