5.8.47. KEEP directive

The KEEP directive instructs the assembler to retain local symbols in the symbol table in the object file.

Syntax

The syntax of KEEP is:

KEEP {symbol}

where:

symbol

is the name of the local symbol to keep. If symbol isnot specified, all local symbols are kept except register-relative symbols.

Usage

By default, the assembler only describes exported symbols in its output object file. Use KEEP to preserve local symbols that can be used to help debugging. Kept symbols appear in the ARM debuggers and in linker map files.

KEEP can be used only after the definition of symbol. This does not apply to KEEP without symbol.

KEEP cannot preserve register-relative symbols. See ^ or MAP directive.

Example

label		ADC		r2,r3,r4
		KEEP		label			; makes label available to debuggers
		ADD		r2,r2,r5
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C
Non-Confidential