10.4 RENAME steering file command

Renames defined and undefined global symbol names.

Syntax

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 pattern does not match any global symbol, the linker ignores the command. The operand can match both defined and undefined symbols.
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 pattern. The characters matched by the pattern wildcard are substituted for the replacement_pattern wildcard.
For example, for a symbol named func1:
RENAME f* AS my_f*
renames func1 to my_func1.

Usage

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.

Example

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
Related concepts
6.6 Edit the symbol tables with a steering file
Non-ConfidentialPDF file icon PDF versionARM DUI0377G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.