1.4.3. Endian support

The ARM compiler has options for producing either little-endian or big-endian objects. ARMv6 supports two different big-endian modes:

BE8

Specifies ARMv6 Byte Invariant Addressing mode. This produces little-endian code and big-endian data. This is the default Byte Addressing mode for ARMv6 big-endian images.

Byte Invariant Addressing mode is only available on ARM processors that support ARMv6.

BE32

This is legacy big-endian mode. It produces big-endian code and data. It is identical to the big-endian mode supported prior to ARMv6. This is the default Byte Addressing mode for all pre-ARMv6 big-endian images.

When compiling for ARMv6 big endian, the ARM compiler generates big-endian objects as BE8 rather than BE32. A flag, set in the object code, labels the code as BE8. Therefore, you must enable BE8 support in the ARM core by setting the E-bit in the CPSR.

You can link legacy objects (for example, ARMv4T) with ARMv6 objects (for running on ARMv6), but in this case the linker switches the byte order of the legacy object code into BE8 mode. The resulting image is BE8.

If you want to use the legacy BE32 mode, then you must set the B bit (bit 7) of CP15 register 1 in your initialization code, or tie the BIGENDINIT input into the core HIGH.

You can then generate BE32-compatible code by using:

--no_unaligned_access

BE32-compatible code must also be linked using the linker option --BE32. Otherwise, the ARMv6 attribute of the objects cause a BE8 image to be produced.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0203G
Non-Confidential