.extern pseudo-op

Purpose

Declares a symbol as an external symbol that is defined in another file.

Syntax

Item Description
.extern Name [ , Visibility ]

Description

The .extern pseudo-op identifies the Name value as a symbol that is defined in another source file, and the Name parameter becomes an external symbol. Any external symbols used but not defined in the current assembly must be declared with an .extern statement. A locally defined symbol that appears in an .extern statement is equivalent to using that symbol in a .globl statement. A symbol not locally defined that appears in a .globl statement is equivalent to using that symbol in an .extern statement. An undefined symbol is flagged as an error unless the -u flag of the as command is used.

Parameters

Item Description
Name Specifies the name of the symbol to be declared as an external symbol. Name can be a Qualname. A Qualname parameter specifies the Name and StorageMappingClass values for the control section.
Visibility Specifies the visibility of symbol. Valid visibility values are exported, protected, hidden, and internal. Symbol visibilities are used by the linker.

Examples

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


   .extern proga[PR]
   .toc
T.proga:   .tc proga[TC],proga[PR]