__attribute__((visibility("default")))
Jakub Jelinek
jakub@redhat.com
Wed Dec 11 05:02:00 GMT 2002
On Tue, Nov 26, 2002 at 11:22:16PM -0800, Richard Henderson wrote:
> The following is needed if we are to ever support command-line
> options that cause all symbols that do not have an explicit
> visibility attribute to be given a visibility other than "default".
>
> Such a thing was proposed by Intel folks some months ago, and
> it didn't seem unreasonable to me. I'm still trying to decide
> if I'm going to go ahead and implement their proposal. I can
> see a use for at least -fvisibility=protected in the Linux kernel...
>
> Applied to mainline, since no released version supports the
> visibility attribute yet.
MODULE_LOCAL_P is still
/* Return true if DECL will be always resolved to a symbol defined in the
same module (shared library or program). */
#define MODULE_LOCAL_P(DECL) \
(lookup_attribute ("visibility", DECL_ATTRIBUTES (DECL)) != NULL)
which means that gcc will think __attribute__((visibility("default")))
vars etc. bind locally.
Shouldn't this be
#define MODULE_LOCAL_P(DECL) \
(decl_visibility (decl) != VISIBILITY_DEFAULT)
?
Jakub
More information about the Gcc-patches
mailing list