Using visibility attributes (IBM extension)
Visibility attributes describe whether and how an entity
that is defined in one module can be referenced or used in other modules.
Visibility attributes affect entities with external linkage only,
and they cannot increase the visibility of other entities. By specifying
visibility attributes for entities, you can export only the entities
that are necessary to shared libraries. With this feature, you can
get the following benefits:
- Decrease the size of shared libraries.
- Reduce the possibility of symbol collision.
- Allow more optimization for the compile and link phases.
- Improve the efficiency of dynamic linking.
- Within a shared library, allow direct access instead of via a TOC pointer.
Supported types of entities
![C++ only](ngcpp_begin.gif)
- Function
- Variable
- Structure/union/class
- Enumeration
- Template
- Namespace
![C++ only](ngcpp_end.gif)
![C only](ngc_begin.gif)
- Function
- Variable
Note: Data types in the C language do not have external linkage,
so you cannot specify visibility attributes for C data types.
![C only](ngc_end.gif)