[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Assembler Language Reference

.ref Pseudo-op

Purpose

Creates a R_REF type entry in the relocation table for one or more symbols.

Syntax

.ref Name[,Name...]

Description

The .ref pseudo-op supports the creation of multiple RLD entries in the same location. This psuedo-op is used in the output of some compilers to ensure the linkage editor does not discard routines that are used but not referenced explicitly in the text or data sections.

For example, in C++, constructors and destructors are used to construct and destroy class objects. Constructors and destructors are sometimes called only from the run-time environment without any explicit reference in the text section.

The following rules apply to the placement of a .ref pseudo-op in the source program:

The following rules apply to the operands of the .ref pseudo-op (the Name parameter):

Parameters

Name Specifies a symbol for which a R_REF type entry in the relocation table should be created.

Examples

The following example demonstrates the use of the .ref pseudo-op:

       .csect a1[pr]
C1:    l 10, 20(20)
       .long  0xff
       .csect  a2[pr]
       .set   r10,10
       .extern C4
C2:    .long   10
C3:    .long   20
       .ref C1,C2,C3
       .ref C4

Related Information

Pseudo-ops Overview.

The discussion of opposite terms concepts in Combination Handling of Expressions . (This discusses another way to generate a R_REF type entry in the relocation table.)

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]