Bug 13213 - Gold does not support the BE-8 big-endian variant of the ARM architecture
Summary: Gold does not support the BE-8 big-endian variant of the ARM architecture
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Cary Coutant
Depends on:
Reported: 2011-09-21 14:51 UTC by Matthew Gretton-Dann
Modified: 2016-12-02 04:14 UTC (History)
3 users (show)

See Also:
Target: arm-none-eabi
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Gretton-Dann 2011-09-21 14:51:43 UTC
Gold only supports the BE-32 (word-invariant) big-endian variant of the ARM architecture (supported in v4, v5, and optionally v6).  v6 and v7 introduce BE-8 variant (byte invariant).

One of the major features of the BE-8 variant is that all instructions are in little-endian format, whereas they are big-endian in BE-32.

The ABI (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf) section 5.5.1 says that object files are produced in BE-32 format and when the linker produces a BE-8 executable image it byte reverses instructions back to little endian format (word-by-word for ARM, half-word-by-half-word for Thumb).  BE-8 executable files have the processor specific flag EF_ARM_BE8 set on the image.

The implication of this is that currently Gold cannot produce images that will run correctly in big-endian mode on ARM v7-A CPUs.
Comment 1 Bharathi Seshardi 2016-08-07 21:25:46 UTC
Proposed patch for BE8 implementation for arm :

Comment 2 Cary Coutant 2016-12-02 04:14:08 UTC
Implemented on trunk: