The compiler provides a header file, elf_linkage.h, in the include sub-directory of the installed toolset. The elf_linkage.h file defines several macros that can be used to control symbol visibility:
This macro imports the declared symbol. The TI_IMPORT macro cannot be applied to symbol definitions.
TI_IMPORT int foo(void);
extern TI_IMPORT long global_variable;
This macro exports the symbol that is being declared or defined. The source module that makes use of this macro must contain a definition of the symbol.
TI_EXPORT int foo(void);
TI_EXPORT long global_variable;
This macro makes the definition of the symbol visible outside of the source module that uses it. Other modules can import the defined symbol. Also, a reference to the symbol can be patched (or re-directed) to a different definition of the symbol if needed. The compiler will generate an indirect call to a function that has been marked as patchable. This technique is also sometimes called symbol preemption.
TI_PATCHABLE int foo(void);
TI_PATCHABLE long global_variable;
This macro specifies that the symbol in question can be either imported or exported. The definition of the symbol is visible outside the module. Other modules can import the symbol definition. Any references to the symbol can also be patched.
This macro specifies that the symbol in question is visible outside of the module. Other modules can import the symbol definition. However, a reference to the symbol can never be patched (symbol is non-preemptable).
The definition of the symbol is not visible outside the module that defines it.