| |||
| Home > ARM Object Format > The AOF header chunk (OBJ_HEAD) > Attributes and alignment | |||
Each area has a set of attributes encoded in the most significant
24 bits of the Attributes + Alignment word. The
least significant eight bits of this word encode the alignment of the
start of the area as a power of 2 and must have a value between
2 and 32 (this value denotes that the area should start at an address
divisible by 2alignment). Table 15.2 gives a summary
of the attributes.
Table 15.2. Area attributes summary
| Bit | Mask | Attribute Description |
|---|---|---|
| 8 9 10 11 12 13 14 15 | 0x00000100 0x00000200 0x00000400 0x00000800 0x00001000 0x00002000 0x00004000 0x00008000 | Absolute attribute Code attribute Common block definition Common block reference Uninitialized (zero-initialized) Read-only Position independent Debugging tables |
| 16 17 18 19 20 21 22 | 0x00010000 0x00020000 0x00040000 0x00080000 0x00100000 0x00200000 0x00400000 | Code areas only Complies with the 32-bit APCS reentrant code Uses extended FP instruction set No software stack checking All relocations are of Thumb code Area may contain ARM halfword instructions Area suitable for ARM/Thumb interworking |
Some combinations of attributes are meaningless, for example, read-only and zero-initialized.
The linker orders areas in a generated image in the following order:
by attributes
by the (case-significant) lexicographic order of area names
by position of the containing object module in the link list.
The position in the link list of an object module loaded from a library is not predictable. The precise significance to the linker of area attributes depends on the output being generated.
Encodes the absolute attribute and denotes that the area must be placed at its Base Address. This bit is not usually set by language processors.
Encodes the code attribute:
Indicates code in the area.
Indicates data in the area.
Specifies that the area is a common definition.
Common areas with the same name are overlaid on each other
by the linker. The Area Size field of a common
definition area defines the size of a common block. All other references
to this common block must specify a size which is smaller than or
equal to the definition size.
If, in a link step, there is more than one definition of an area with the common definition attribute (area of the given name with bit 10 set), each of these areas must have exactly the same contents. If there is no definition of a common area, its size will be the size of the largest common reference to it.
Although common areas conventionally hold data, you can use bit 10 in conjunction with bit 9 to define a common block containing code. This is useful for defining a code area which must be generated in several compilation units, but which should be included in the final image only once.
Defines the area to be a reference to a common block, and precludes the area having initializing data (see Bit 12). In effect, bit 11 implies bit 12. If both bits 10 and 11 are set, bit 11 is ignored.
Encodes the zero-initialized attribute,
specifying that the area has no initializing data in this object
file, and that the area contents are missing from the OBJ_AREA chunk.
Typically, this attribute is given to large municipalized data areas. When a municipalized area is included in an image, the linker either includes a read-write area of binary zeros of appropriate size, or maps a read-write area of appropriate size that will be zeroed at image startup time. This attribute is incompatible with the read-only attribute (see Bit 13, below).
Whether or not a zero-initialized area is re-zeroed if the image is re-entered is a property of the relevant image format and/or the system on which it will be executed. The definition of AOF neither requires nor precludes re-zeroing.
A combination of bit 10 (common definition) and bit 12 (zero-initialized) has exactly the same meaning as bit 11 (reference to common).
Encodes the read only attribute and denotes that the area will not be modified following relocation by the linker. The linker groups read-only areas together so that they may be write-protected at runtime, hardware permitting. Code areas and debugging tables must have this bit set. The setting of this bit is incompatible with the setting of bit 12.
Encodes the position independent (PI) attribute, usually only of significance for code areas. Any reference to a memory address from a PI area must be in the form of a link-time-fixed offset from a base register (for example, a pc-relative branch offset).
Encodes the debugging table attribute and denotes that the area contains symbolic debugging tables. The linker groups these areas together so they can be accessed as a single continuous chunk at or before runtime (usually, a debugger extracts its debugging tables from the image file prior to starting the debuggee). Usually, debugging tables are read-only and, therefore, have bit 13 set also. In debugging table areas, bit 9 (the code attribute) is ignored.
Bits 16-22 encode additional attributes of code areas and must be non-zero only if the area has the code attribute (bit 9) set. Bits 20-22 can be non-zero for data areas.
Encodes the 32-bit PC attribute, and denotes that code in this area complies with a 32-bit variant of the APCS.
Encodes the reentrant attribute, and denotes that code in this area complies with a reentrant variant of the APCS.
When set, denotes
that code in this area uses the ARM floating-point instruction set.
Specifically, function entry and exit use the LFM and SFM floating-point
save and restore instructions rather than multiple LDFEs
and STFEs. Code with this attribute may not execute
on older ARM-based systems.
Encodes the No Software Stack Check attribute, denoting that code in this area complies with a variant of the APCS without software stack-limit checking.
Indicates that this area is a Thumb code area.
Indicates that this area may contain ARM halfword instructions. This bit is set by armcc when compiling code for a processor with halfword instructions such as the ARM7TDMI.
Indicates that this area has been compiled to be suitable for ARM/Thumb interworking. See the ARM Software Development Toolkit User Guide.
Are reserved and are set to 0.