How do I assemble assembly that is intended for armas?

Question

How do I assemble assembly that is intended for armas?

Answer

Assembly that is intended for use with ARM's RealView assembler has to be manually converted before it can be used with the GNU assembler (GAS) provided with Sourcery CodeBench. While the two assemblers use generally similar syntax for individual instructions, all of the assembler directives are different.

The GNU comment character is @.

Here is a summary of some commonly used directives:

RealView GNU
AREA .section
CODE32 .code 32
EXPORT .global
EXTERN .extern
IMPORT See IMPORT below
FIELD .equate
MAP .equate
REQUIRE8 {TRUE} .eabi_attribute Tag_ABI_align_needed, 1, see ABI Attribute Tags below
REQUIRE8 {FALSE} .eabi_attribute Tag_ABI_align_needed, 0, see ABI Attribute Tags below
PRESERVE8 {TRUE} .eabi_attribute Tag_ABI_align_preserved, 1, see ABI Attribute Tags below
PRESERVE8 {FALSE} .eabi_attribute Tag_ABI_align_preserved, 0, see ABI Attribute Tags below

The full syntax of the GNU directives is explained in the "Assembler Directives" section of the GNU assembler manual provided with Sourcery CodeBench.

IMPORT

The ARM assembler IMPORT directive creates an undefined reference to an external symbol even if that symbol is not used. There is no equivalent GNU directive. You may in general remove such directives when converting to use of the GNU assembler.

ABI Attribute Tags

Please see the ABI addenda for more information about ABI attribute tags including Tag_ABI_align_needed and Tag_ABI_align_preserved.


This entry was last updated on 8 March 2013.