Difference between -shared, -symbolic, and -G?

Ian Lance Taylor iant@google.com
Fri Oct 30 04:56:00 GMT 2009


Todd <todd.freed@gmail.com> writes:

> Hmm. I just need to have a function in my shared library, callable
> from the executable linked against the shared library, which I can
> also call 
> from inside the shared library such that calls originating inside
> always 
> invoke the one defined inside. What is the right way to achieve this, then?

Give the function in the library protected visibility, using gcc's
-fvisibility option or __attribute__ ((visibility ("protected"))).

Ian



More information about the Gcc-help mailing list