SPRUI03E June 2015 – January 2023
Create an Artificial Reference from a Section to a Symbol
.symdepend dst symbol name[,src symbol name]
The .symdepend directive creates an artificial reference from the section defining src symbol name to the symbol dst symbol name. This prevents the linker from removing the section containing dst symbol name if the section defining src symbol name is included in the output module. If src symbol name is not specified, a reference from the current section is created.
A global symbol is defined in the same manner as any other symbol; that is, it appears as a label or is defined by the .set, .equ, .bss or .usect directive. If a global symbol is defined more than once, the linker issues a multiple-definition error. (The assembler can provide a similar multiple-definition error for local symbols.)
The .symdepend directive creates a symbol table entry only if the module actually uses the symbol. The .weak directive, in contrast, always creates a symbol table entry for a symbol, whether the module uses the symbol or not (see .weak topic).
If the symbol is defined in the current module, use the .symdepend directive to declare that the symbol and its definition can be used externally by other modules. These types of references are resolved at link time.