aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2018-07-03 09:14:45 +0200
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-07-03 17:35:08 +0200
commita9c4dde3642a71be377804bec86b2898c2b15d3d (patch)
tree4e8a22acaa6815466fb7676f9809b2b7fd6b6d50 /Makefile
parent700b6da722a87de65b0b66421bb5ec26c69a27b7 (diff)
downloadtrusted-firmware-a-a9c4dde3642a71be377804bec86b2898c2b15d3d.tar.gz
AArch32: Force compiler to align memory accesses
Alignment fault checking is always enabled in TF (by setting the SCTLR.A bit). Thus, all instructions that load or store one or more registers have an alignment check that the address being accessed is aligned to the size of the data element(s) being accessed. If this check fails it causes an Alignment fault, which is taken as a Data Abort exception. The compiler needs to be aware that it must not emit load and store instructions resulting in unaligned accesses. It already is for AArch64 builds (see commit fa1d37122c "Add -mstrict-align to the gcc options"), this patch does the same for AArch32 builds. Change-Id: Ic885796bc6ed0ff392aae2d49f3a13f517e0169f Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f230f4af3a..180c558420 100644
--- a/Makefile
+++ b/Makefile
@@ -151,6 +151,7 @@ TF_CFLAGS_aarch32 = $(march32-directive)
TF_CFLAGS_aarch64 = -march=armv8-a
endif
+TF_CFLAGS_aarch32 += -mno-unaligned-access
TF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align
ASFLAGS_aarch32 = $(march32-directive)