Migration and Compatibility GuidePreface Configuration and Support Information Migrating from Arm Compiler 5 to Arm Compiler 6 Migrating from armcc to armclang Compiler Source Code Compatibility Migrating from armasm to the armclang Integrated A Migration of assembler command-line options from a Overview of differences between armasm and GNU syn Comments Labels Numeric local labels Functions Sections Symbol naming rules Numeric literals Operators Alignment PC-relative addressing A32 and T32 instruction substitutions A32 and T32 pseudo-instructions Conditional directives Data definition directives Instruction set directives Miscellaneous directives Symbol definition directives Migration of armasm macros to integrated assembler Changes Between Different Versions of Arm Compiler Code Examples Licenses
Sections are independent, named, indivisible chunks of code or data that are manipulated by the linker.
Section attributes within the
AREA mysection, CODE, READONLY, ALIGN=3
Flags provide information about the section. Available section flags include the following:
Not all armasm syntax
.section mysection,"ax" .balign 8
When using Arm® Compiler 5, section names do not need to be unique. Therefore, you could use the same section name to create different section types.
Arm Compiler 6 supports multiple sections with the same section name only if you specify a unique ID. You must ensure that different section types either:
If you use the same section name for another section or symbol, without a unique ID, then
// stores both the code and data in one section // uses the flags from the first section .section "sectionX", "ax" mov r0, r0 .section "sectionX", "a", %progbits .word 0xdeadbeef // stores both the code and data in one section // uses the flags from the first section .section "sectionY", "a", %progbits .word 0xdeadbeef .section "sectionY", "ax" mov r0, r0
When you assemble the above example code with:
armclang --target=arm-arm-none-eabi -c -march=armv8-m.main example_sections.s
The armclang integrated assembler:
of your data.