The RENAME command renames defined and undefined global symbol names.
RENAME
pattern
AS replacement_pattern
[ ,pattern
AS replacement_pattern
]
where:
pattern
is a string, optionally including wildcard characters (either
*
or?
), that matches zero or more global symbols. If
does not match any global symbol, the linker ignores the command. The operand can match both defined and undefined symbols.pattern
replacement_pattern
is a string, optionally including wildcard characters (either
*
or?
), to which the symbol is to be renamed. Wild characters must have a corresponding wildcard in
. The characters matched by thepattern
wildcard are substituted for thepattern
wildcard.replacement_pattern
For example, for a symbol named
func1
:RENAME f* AS my_f*
renames
func1
tomy_func1
.
You cannot rename a symbol to a global symbol name that already exists, even if the target symbol name is being renamed itself.
You cannot rename a symbol to the same name as another symbol. For example, you cannot do the following:
RENAME foo1 bar RENAME foo2 bar
Renames only take effect at the end of the link step. Therefore, renaming a symbol does not remove its original name. This means that you cannot do the following:
RENAME func1 func2 RENAME func2 func3
The linker gives an error that func1 cannot be renamed to func2 as a symbol already exists with that name.
Only one wildcard character (either *
or ?
)
is permitted in RENAME.
Given an image containing the symbols func1
, func2
,
and func3
, you might have a steering file containing
the following commands:
;invalid, func2 already exists EXPORT func1 AS func2 ; valid RENAME func3 AS b2 ;invalid, func3 still exists because the link step is not yet complete EXPORT func1 AS func3
- Concepts
Using the Linker: