# ARM object format

An object file written in ARM Object Format (AOF) consists of any number of named, attributed areas. Attributes include: read-only; reentrant; code; data; position independent; etc. (for details see Attributes + Alignment of the Technical Specifications). Typically, a compiled AOF file contains a read-only code area, and a read-write data area, (a 0-initialised data area is also common, and reentrant code uses a separate based area for address constants).

Associated with each area is a (possibly empty) list of relocation directives which describe locations that the linker will have to update when:

- a non-zero base address is assigned to the area;
- a symbolic reference is resolved.

Each relocation directive may be given relative to the (not yet assigned) base address of an area in the same AOF file, or relative to a symbol in the symbol table. Each symbol may:

- have a definition within its containing object file which is local to the object file;

- have a definition within the object file which is visible globally (to all object files in the link step);

- be a reference to a symbol defined in some other object file.

When AOF is used as an output format, the linker does the following with its input object files:

- merges similarly named and attributed areas;

- performs PC-relative relocations between merged areas;

- re-writes symbol-relative relocation directives between merged areas, as area-based relocation directives belonging to the merged area;

- minimises the symbol table.

Unresolved references remain unresolved, and the output AOF file may be used as the input to a further link step.