User's Guide
Passing Options to the Linker with -W
The following example links file.o and passes the option -a archive to the linker, indicating
that the archive version of the math library (indicated by -lm) and all other driver-supplied libraries
should be used rather than the default shared library:
aCC file.o -Wl,-a,archive -lm
Passing Multiple Options to the Linker with -W
The following example links file.o and passes the options -a , archive, -m, and -v to the
linker:
aCC -Wl,-a,archive,-m,-v file.o -lm
This case is similar to the previous example, with additional options. -m indicates that a load map
should be produced. The -v option requests verbose messages from the linker.
Symbol Binding Options
The following -B options are recognized by the compiler to specify whether references to global
symbols may be resolved to symbols defined in the current load module, or whether they must be
assumed to be potentially resolved to symbols defined in another load module.
A global symbol is one that is visible by name across translation unit boundaries. A static symbol
is one that is visible by name only within a single translation unit but is not associated with a
particular procedure activation. A locally defined symbol is a global or static symbol with a
definition in the translation unit from which it is being referenced.
-Bdefault
-Bdefault
Global symbols are assigned the default export class. These symbols may be imported or exported
outside of the current load module. The compiler will access tentative and undefined symbols
through the linkage table. Any symbol that is not assigned to another export class through use of
another -B option will have the default export class. The -Bdefault option may also be used
on a per symbol basis to specify exceptions to global -Bprotected, -Bhidden, and -Bextern
options.
Usage:
-Bdefault=symbol[,symbol...]
The named symbols are assigned the default export class.
-Bdefault:filename
The file indicated by filename contains a list of symbols, separated by spaces or newlines. These
symbols are assigned the default export class.
-Bextern
-Bextern
The specified symbols, or all undefined symbols if no list is provided, are assigned to default export
class. Additionally, the compiler will inline the import stub for calls to these symbols. No compile
time binding of these symbols will be done. All references to these symbols will be through the
linkage table, so an unnecessary performance penalty will occur if -Bextern is applied to a listed
symbol that is resolved in the same load module.
Usage:
-Bextern=symbol[,symbol...]
The named symbols, or all symbols if no list is provided, are assigned the default export class. Use
of list form overrides the default binding of locally defined symbols.
Symbol Binding Options 89