[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Assembler Language Reference
.weak Pseudo-op
Purpose
Makes a symbol with weak binding globally visible to the linker.
Syntax
Description
The .weak pseudo-op makes the symbol Name globally visible
to the linker and available to any file that is linked to the file in which
either the .globl or .weak pseudo-op occurs. However, the
symbol has weak binding semantics.
- If the .weak pseudo-op is not used for a symbol, then that symbol
is, unless otherwise effected, only visible within the current assembly and
not to other modules that may later be linked to the current assembly.
- If Name is defined in the current assembly, its type and value
arise from that definition, not the .weak definition.
- Once .weak has been seen for a symbol, latter occurances of .globl and .extern will not affect it for that file.
- The binder ignores duplicate definitions for symbols with the same name
that are weak. If the name is declared .globl in one object file
of module, and .weak in another, the global definition is used and
the weak ones are ignored. If no global definition (such as the C_EXT storage class ) exists, the first weak definition is used, according
to link order as described by the ld reference page.
Parameters
Name |
Represents any label or symbol that is defined locally and requires
external visibility with weak storage class. This parameter can be a Qualname. (A Qualname specifies a Name and StorageMappingClass for the control section.) |
Examples
The following example illustrates the use of the .weak pseudo-op:
.weak foo[RW]
.csect data[RW]
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]