Everything

.weak [V2.07.00 or later]


Declares to the optimizing linker that the symbol described in the operand field is to be referenced from another module as a WEAK symbol.

[Syntax]

Symbol field

Mnemonic field

Operand field

Comment field

[label:]
.weak
symbol-name
[; comment]

[Function]

-

The .weak directive declares to the optimizing linker that the symbol described in the operand field is to be referenced from another module as a WEAK symbol.

[Use]

-

When defining a symbol to be referenced from another module, use the .public or .weak directive to declare that symbol as an external definition.

[Description]

-

The symbol specified by the operand is declared as a WEAK symbolNote.

Note

This is a symbol with a WEAK binding class.

 

-

This directive differs from the .public directive in the following points.

-

If symbols having the same name exist in different modules, specifying the .public directive for each of these symbols causes an error during linking.

-

If symbols having the same name exist in different modules and the .public directive is specified for one symbol and the .weak directive is specified for others, the module with the .public directive specified is linked. In this case, no error occurs.

-

If symbols having the same name exist in different modules and the .weak directive is specified for each of these symbols, any one of the modules is linked without causing an error.

-

The .weak directive may be described anywhere in a source program.

-

The following symbols cannot be used as the operand:

(a)

Symbol defined with the .set directive

(b)

Section name

(c)

Macro name