Skip to content

Commit 8edf844

Browse files
sjg20wdenx
authored andcommitted
sandbox: Force command sections to be 4-byte aligned
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>
1 parent 7115239 commit 8edf844

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/command.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
117117
#define CMD_FLAG_REPEAT 0x0001 /* repeat last command */
118118
#define CMD_FLAG_BOOTD 0x0002 /* command is from bootd */
119119

120-
#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))
120+
#define Struct_Section __attribute__((unused, section(".u_boot_cmd"), \
121+
aligned(4)))
121122

122123
#ifdef CONFIG_AUTO_COMPLETE
123124
# define _CMD_COMPLETE(x) x,

0 commit comments

Comments
 (0)