[U-Boot] [RFC] ARM: prevent misaligned array inits

Måns Rullgård mans at mansr.com
Tue Oct 2 23:42:04 CEST 2012


Albert ARIBAUD <albert.u.boot at aribaud.net> writes:

> Under option -munaligned-access, gcc can perform local char
> or 16-bit array initializations using misaligned native
> accesses which will throw a data abort exception. Fix files
> where these array initializations were unneeded, and for
> files known to contain such initializations, enforce gcc
> option -mno-unaligned-access.

Why don't you just stop setting the damn strict alignment flag on ARMv6
and later instead this endless hacking around?

You really have only two sane choices here:

1. Keep strict alignment checking and build with -mno-unaligned-access.
2. Drop strict alignment checking and build with (implicit) -munaligned-access.

Option 2 gives faster, smaller code, so the choice should be an easy one
to make.

-- 
Måns Rullgård
mans at mansr.com



More information about the U-Boot mailing list