You copied the Doc URL to your clipboard.

Arm Compiler armasm User Guide : KEEP


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


KEEP {label}



is the name of the local label to keep. If label is not specified, all named local labels are kept except register-relative labels.


By default, the only labels that the assembler describes in its output object file are:

  • Exported labels.

  • Labels that are relocated against.

Use KEEP to preserve local labels. This can help when debugging. Kept labels appear in the Arm debuggers and in linker map files.

KEEP cannot preserve register-relative labels or numeric local labels.


label   ADC     r2,r3,r4
        KEEP    label       ; makes label available to debuggers
        ADD     r2,r2,r5