From: Tom Rini Date: Mon, 8 Oct 2012 12:31:25 -0700 Subject: [U-Boot] [PATCH V3] ARM: prevent misaligned array inits In-Reply-To: <1349723944-8188-1-git-send-email-albert.u.boot@aribaud.net> References: <1349464558-7311-1-git-send-email-albert.u.boot@aribaud.net> <1349723944-8188-1-git-send-email-albert.u.boot@aribaud.net> Message-ID: <20121008193125.GI18891@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Oct 08, 2012 at 09:19:04PM +0200, Albert ARIBAUD wrote: > 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. > > Signed-off-by: Albert ARIBAUD [snip] > diff --git a/common/Makefile b/common/Makefile > index 973f05a..39dbe16 100644 > --- a/common/Makefile > +++ b/common/Makefile > @@ -232,6 +232,9 @@ $(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc > $(obj)../tools/envcrc: > $(MAKE) -C ../tools > > +$(obj)hush.o: CFLAGS += -mno-unaligned-access > +$(obj)fdt_support.o: CFLAGS += -mno-unaligned-access Forgot a '# SEE doc/...' here. [snip] > +If you are reading this because of a data abort: the following MIGHT > +be relevant to your abort, if it was caused by an alignment violation. > +In order to determine this, use the PC from the abort dump along with > +an objdump -s -S of the u-boot ELF binary to locate the function where > +the abort happened; then compare this function with the examples below. You should also add something about how if you are able to reach the U-Boot prompt before the abort happens, if CONFIG_CMD_BDI is set the 'bdinfo' command will give you the relocation offset to apply to the PC. Otherwise looks good. Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: