]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Force command sections to be 4-byte aligned
authorSimon Glass <sjg@chromium.org>
Sat, 17 Sep 2011 06:48:51 +0000 (06:48 +0000)
committerWolfgang Denk <wd@denx.de>
Mon, 17 Oct 2011 21:56:58 +0000 (23:56 +0200)
By default sections are 16-byte aligned on some architectures, but the
command name structure (struct cmd_tbl_s) does not have padding to
16 bytes. This reduces the alignment to 4-bytes so that the command
table can be accessed correctly on any architecture.

(Note: this needs doing properly)

Signed-off-by: Simon Glass <sjg@chromium.org>
include/command.h

index f1accd0953ecf89785bf9fa3a9e10dd7fb527b6d..c2701101d5b5824e8e89d0304890e0411b4bce6a 100644 (file)
@@ -117,7 +117,8 @@ extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #define CMD_FLAG_REPEAT                0x0001  /* repeat last command          */
 #define CMD_FLAG_BOOTD         0x0002  /* command is from bootd        */
 
-#define Struct_Section  __attribute__ ((unused,section (".u_boot_cmd")))
+#define Struct_Section  __attribute__((unused, section(".u_boot_cmd"), \
+               aligned(4)))
 
 #ifdef CONFIG_AUTO_COMPLETE
 # define _CMD_COMPLETE(x) x,