4.15 Miscellaneous directives

Miscellaneous directives perform a range of different functions.

The following table shows how to translate ARM® syntax miscellaneous directives to GNU syntax directives:

Table 4-5 Miscellaneous directives translation

ARM syntax directive GNU syntax directive Description
foo EQU 0x1C .equ foo, 0x1C Assigns a value to a symbol. Note the rearrangement of operands.
EXPORT StartHere
GLOBAL StartHere
.global StartHere
.type StartHere, @function
Declares a symbol that can be used by the linker (that is, a symbol that is visible to the linker).
armasm automatically determines the types of exported symbols. However, armclang requires that you explicitly specify the types of exported symbols using the .type directive.
If the .type directive is not specified, the linker outputs warnings of the form:
Warning: L6437W: Relocation #RELA:1 in test.o(.text) with respect to symbol...
Warning: L6318W: test.o(.text) contains branch to a non-code symbol symbol.
GET file
.include file Includes a file within the file being assembled.
IMPORT foo .global foo Provides the assembler with a name that is not defined in the current assembly.
INCBIN .incbin Partial support, armclang does not fully support .incbin.
INFO n, "string" .warning "string" The INFO directive supports diagnostic generation on either pass of the assembly (specified by n). The .warning directive does not let you specify a particular pass.
ENTRY armlink --entry=location The ENTRY directive declares an entry point to a program. armclang does not provide an equivalent directive. Use armlink --entry=location to specify the entry point directly to the linker, rather than defining it in the assembly code.
END .end Marks the end of the assembly file.
Related information
GNU Binutils - Using as: .type
GNU Binutils - Using as: .warning
GNU Binutils - Using as: .equ
GNU Binutils - Using as: .global
GNU Binutils - Using as: .include
GNU Binutils - Using as: .incbin
armasm User Guide: ENTRY
armasm User Guide: END
armasm User Guide: INFO
armasm User Guide: EXPORT or GLOBAL
armlink User Guide: --entry
Non-ConfidentialPDF file icon PDF versionARM DUI0742F
Copyright © 2014-2016 ARM. All rights reserved.