SPRUI03E June 2015 – January 2023
Symbol localization changes symbol linkage from global to local (static). This is used to obscure global symbols that should not be widely visible, but must be global because they are accessed by several modules in the library. The linker supports symbol localization through the --localize and --globalize linker options.
The syntax for these options are:
--localize='pattern'
--globalize='pattern'
The pattern is a "glob" (a string with optional ? or * wildcards). Use ? to match a single character. Use * to match zero or more characters.
The --localize option changes the symbol linkage to local for symbols matching the pattern.
The --globalize option changes the symbol linkage to global for symbols matching the pattern. The --globalize option only affects symbols that are localized by the --localize option. The --globalize option excludes symbols that match the pattern from symbol localization, provided the pattern defined by --globalize is more restrictive than the pattern defined by --localize.
See Section 9.5.2 for information about using C/C++ identifiers in linker options such as --localize and --globalize.
These options have the following properties:
In map files these symbols are listed under the Localized Symbols heading.