Directives Reference
7-52 Copyright © 2000, 2001 ARM Limited. All rights reserved. ARM DUI 0068B
7.7.2 AREA
The
AREA
directive instructs the assembler to assemble a new code or data section.
Sections are independent, named, indivisible chunks of code or data that are
manipulated by the linker. See ELF sections and the AREA directive on page 2-15 for
more information.
Syntax
AREA sectionname{,attr}{,attr}...
where:
sectionname
is the name that the section is to be given.
You can choose any name for your sections. However, names starting
with a digit must be enclosed in bars or a missing section name error is
generated. For example,
|1_DataArea|
.
Certain names are conventional. For example,
|.text|
is used for code
sections produced by the C compiler, or for code sections otherwise
associated with the C library.
attr
are one or more comma-delimited section attributes. Valid attributes are:
ALIGN=expression
By default, ELF sections are aligned on a 4-byte boundary.
expression
can have any integer value from 0 to 31. The
section is aligned on a 2
expression
-byte boundary. For example,
if expression is 10, the section is aligned on a 1KB boundary.
This is not the same as the way that the
ALIGN
directive is
specified. See ALIGN on page 7-50.
Note
Do not use
ALIGN=0
or
ALIGN=1
for code sections.
ASSOC=section
section
specifies an associated ELF section.
sectionname
must
be included in any link that includes
section
CODE
Contains machine instructions.
READONLY
is the default.
COMDEF
Is a common section definition. This ELF section can contain
code or data. It must be identical to any other section of the
same name in other source files.