From c3fc03bc2e3c7745f261f3b3fbffef6d49617f9c Mon Sep 17 00:00:00 2001 From: Ryan Lin Date: Mon, 13 Oct 2014 14:22:38 -0700 Subject: [PATCH] coreboot: force 4-byte alignment for init structure with GCC 4.9 Force 4-byte alignment for .bs_init section to ensure that no padding data is added to init structures. BUG=chromium:416651 BRANCH=none TEST=build firmware with GCC 4.9 and test on Auron and Rambi. Change-Id: I3f94cd419b5951fdc6e5749576c4df2cc44f8a24 Signed-off-by: Ryan Lin Reviewed-on: https://chromium-review.googlesource.com/223116 Reviewed-by: Shawn Nematbakhsh Reviewed-by: Kenji Chen Reviewed-by: Duncan Laurie --- src/include/bootstate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/bootstate.h b/src/include/bootstate.h index af189897d8..cd753042ab 100644 --- a/src/include/bootstate.h +++ b/src/include/bootstate.h @@ -176,7 +176,8 @@ struct boot_state_init_entry { struct boot_state_callback bscb; }; -#define BOOT_STATE_INIT_ATTR __attribute__ ((used,section (".bs_init"))) +#define BOOT_STATE_INIT_ATTR \ + __attribute__ ((used, aligned(4), section(".bs_init"))) #define BOOT_STATE_INIT_ENTRIES(name_) \ static struct boot_state_init_entry name_[] BOOT_STATE_INIT_ATTR