8.1. Symbol visibility

Within a module there might be functions and data that must be made available to other modules. Conversely there might be functions and data that are private to a module.To control whether symbol definitions are made available, each symbol has an associated visibility property. The symbol visibility of a definition controls whether a symbol is visible externally to the module and also whether the symbol can be pre-empted at run-time.The symbol visibility also applies to a symbol reference. Therefore, symbol visibility can be used to control whether particular references can be resolved at dynamic link time or must be resolved as static link time.ELF supports four different visibility properties, default, protected, hidden and internal. Table 8.1 summarizes these:

Table 8.1. ELF visibility

VisibilityELF NameDynamically linkable?
DefaultSTV_DEFAULTYes
ProtectedSTV_PROTECTEDYes
HiddenSTV_HIDDENNo
InternalSTV_INTERNALNo

In addition to visibility, ELF also supports a binding property. This property is separate to the visibility property and is normally used to indicate, global, local, or weak binding for a symbol. The symbol binding property is normally used by the object producer to control how the static linker resolves references to that symbol. For example, static symbols in C normally have local binding which prevents the static linker resolving references from other object files to the local definition.

Copyright © 2010 ARM. All rights reserved.ARM DAI 0242A
Non-ConfidentialID011411