The visibility variable attribute
The visibility variable attribute describes whether and how a variable defined in one module can be referenced or used in other modules. The visibility attribute affects only variables with external linkage. By using this feature, you can make a shared library smaller and decrease the possibility of symbol collision. For details, see Using visibility attributes.
Example
In the following example, the visibility
attribute of variable a is protected, and that of
variable b is hidden:
struct str{
int var;
};
int a __attribute__((visibility("protected")));
struct str __attribute__((visibility("hidden"))) b;