HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


WXTRN instruction

HLASM Language Reference
SC26-4940-06

The WXTRN statement identifies "weak external" symbols referred to in a source module but defined in another source module. The WXTRN instruction differs from the EXTRN instruction (see EXTRN instruction) as follows:
  • The EXTRN instruction causes the linker to automatically search libraries (if automatic library call is in effect) to find the module that contains the external symbols that you identify in its operand field. If the module is found, linkage addresses are resolved; the module is then linked to your module, which contains the EXTRN instruction.
  • The WXTRN instruction suppresses automatic search of libraries. The linker only resolves the linkage addresses if the external symbols that you identify in the WXTRN operand field are defined in one of these ways:
    • In a module that is linked and loaded along with the object module assembled from your source module.
    • In a module brought in from a library because of the presence of an EXTRN instruction in another module linked and loaded with yours.
Read syntax diagramSkip visual syntax diagram
>>-+-----------------+--WXTRN----------------------------------->
   '-sequence_symbol-'          

   .-,-------------------------------.   
   V                                 |   
>----+-external_symbol-------------+-+-------------------------><
     |       .-,---------------.   |     
     |       V                 |   |     
     '-PART(---external_symbol-+-)-'     

sequence_symbol
Is a sequence symbol.
external_symbol
Is a relocatable symbol that is not:
  • Used as the name entry of a source statement in the source module in which it is defined
PART(external_symbol)
external_symbol is a relocatable symbol as described above, that also:
  • Is a reference to a part as defined on the CATTR instruction.

The external symbols identified by a WXTRN instruction have the same properties as the external symbols identified by the EXTRN instruction. However, the type code assigned to these external symbols differs.

V-Type Address Constant: If a symbol, specified in a V-type address constant, is also identified by a WXTRN instruction, it is assigned the same ESD type code as the symbol in the WXTRN instruction, and is treated by the linkage editor as a weak external symbol.

If an external symbol is identified by both an EXTRN and WXTRN instruction in the same source module, the first declaration takes precedence, and subsequent declarations are flagged with diagnostic messages.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014