Declares to the optimizing linker that the symbol described in the operand field is to be referenced from another module as a WEAK symbol.
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. |
When defining a symbol to be referenced from another module, use the .public or .weak directive to declare that symbol as an external definition. |
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. |