aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-11-30 13:03:03 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2020-11-30 13:03:03 +0100
commit965b795b87c59ed45cc7f16a62301dbae65b1627 (patch)
tree958e486f4f23177746ddee11913d3b59ff4e7f8e /shell
parent2fba2f5bb99145eaa1635fe5a162426158d56a2c (diff)
downloadbusybox-w32-965b795b87c59ed45cc7f16a62301dbae65b1627.tar.gz
busybox-w32-965b795b87c59ed45cc7f16a62301dbae65b1627.tar.bz2
busybox-w32-965b795b87c59ed45cc7f16a62301dbae65b1627.zip
decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly
text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c6
-rw-r--r--shell/hush.c12
-rw-r--r--shell/shell_common.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8c9a590d1..40695dee0 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2091,7 +2091,7 @@ static const struct {
2091 int flags; 2091 int flags;
2092 const char *var_text; 2092 const char *var_text;
2093 void (*var_func)(const char *) FAST_FUNC; 2093 void (*var_func)(const char *) FAST_FUNC;
2094} varinit_data[] = { 2094} varinit_data[] ALIGN_PTR = {
2095 /* 2095 /*
2096 * Note: VEXPORT would not work correctly here for NOFORK applets: 2096 * Note: VEXPORT would not work correctly here for NOFORK applets:
2097 * some environment strings may be constant. 2097 * some environment strings may be constant.
@@ -4811,7 +4811,7 @@ static char *cmdnextc;
4811static void 4811static void
4812cmdputs(const char *s) 4812cmdputs(const char *s)
4813{ 4813{
4814 static const char vstype[VSTYPE + 1][3] = { 4814 static const char vstype[VSTYPE + 1][3] ALIGN1 = {
4815 "", "}", "-", "+", "?", "=", 4815 "", "}", "-", "+", "?", "=",
4816 "%", "%%", "#", "##" 4816 "%", "%%", "#", "##"
4817 IF_BASH_SUBSTR(, ":") 4817 IF_BASH_SUBSTR(, ":")
@@ -8510,7 +8510,7 @@ enum {
8510 , /* thus far 29 bits used */ 8510 , /* thus far 29 bits used */
8511}; 8511};
8512 8512
8513static const char *const tokname_array[] = { 8513static const char *const tokname_array[] ALIGN_PTR = {
8514 "end of file", 8514 "end of file",
8515 "newline", 8515 "newline",
8516 "redirection", 8516 "redirection",
diff --git a/shell/hush.c b/shell/hush.c
index f1a7e07ee..b6d9d7abb 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -596,10 +596,10 @@ typedef struct in_str {
596/* The descrip member of this structure is only used to make 596/* The descrip member of this structure is only used to make
597 * debugging output pretty */ 597 * debugging output pretty */
598static const struct { 598static const struct {
599 int mode; 599 int32_t mode;
600 signed char default_fd; 600 signed char default_fd;
601 char descrip[3]; 601 char descrip[3];
602} redir_table[] = { 602} redir_table[] ALIGN4 = {
603 { O_RDONLY, 0, "<" }, 603 { O_RDONLY, 0, "<" },
604 { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" }, 604 { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" },
605 { O_CREAT|O_APPEND|O_WRONLY, 1, ">>" }, 605 { O_CREAT|O_APPEND|O_WRONLY, 1, ">>" },
@@ -1143,7 +1143,7 @@ struct built_in_command {
1143#endif 1143#endif
1144}; 1144};
1145 1145
1146static const struct built_in_command bltins1[] = { 1146static const struct built_in_command bltins1[] ALIGN_PTR = {
1147 BLTIN("." , builtin_source , "Run commands in file"), 1147 BLTIN("." , builtin_source , "Run commands in file"),
1148 BLTIN(":" , builtin_true , NULL), 1148 BLTIN(":" , builtin_true , NULL),
1149#if ENABLE_HUSH_JOB 1149#if ENABLE_HUSH_JOB
@@ -1228,7 +1228,7 @@ static const struct built_in_command bltins1[] = {
1228/* These builtins won't be used if we are on NOMMU and need to re-exec 1228/* These builtins won't be used if we are on NOMMU and need to re-exec
1229 * (it's cheaper to run an external program in this case): 1229 * (it's cheaper to run an external program in this case):
1230 */ 1230 */
1231static const struct built_in_command bltins2[] = { 1231static const struct built_in_command bltins2[] ALIGN_PTR = {
1232#if ENABLE_HUSH_TEST 1232#if ENABLE_HUSH_TEST
1233 BLTIN("[" , builtin_test , NULL), 1233 BLTIN("[" , builtin_test , NULL),
1234#endif 1234#endif
@@ -3895,7 +3895,7 @@ struct reserved_combo {
3895 char literal[6]; 3895 char literal[6];
3896 unsigned char res; 3896 unsigned char res;
3897 unsigned char assignment_flag; 3897 unsigned char assignment_flag;
3898 int flag; 3898 uint32_t flag;
3899}; 3899};
3900enum { 3900enum {
3901 FLAG_END = (1 << RES_NONE ), 3901 FLAG_END = (1 << RES_NONE ),
@@ -3928,7 +3928,7 @@ static const struct reserved_combo* match_reserved_word(o_string *word)
3928 * to turn the compound list into a command. 3928 * to turn the compound list into a command.
3929 * FLAG_START means the word must start a new compound list. 3929 * FLAG_START means the word must start a new compound list.
3930 */ 3930 */
3931 static const struct reserved_combo reserved_list[] = { 3931 static const struct reserved_combo reserved_list[] ALIGN4 = {
3932# if ENABLE_HUSH_IF 3932# if ENABLE_HUSH_IF
3933 { "!", RES_NONE, NOT_ASSIGNMENT , 0 }, 3933 { "!", RES_NONE, NOT_ASSIGNMENT , 0 },
3934 { "if", RES_IF, MAYBE_ASSIGNMENT, FLAG_THEN | FLAG_START }, 3934 { "if", RES_IF, MAYBE_ASSIGNMENT, FLAG_THEN | FLAG_START },
diff --git a/shell/shell_common.c b/shell/shell_common.c
index 42c4c9c97..dcbe0d109 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -324,7 +324,7 @@ struct limits {
324 uint8_t factor_shift; /* shift by to get rlim_{cur,max} values */ 324 uint8_t factor_shift; /* shift by to get rlim_{cur,max} values */
325}; 325};
326 326
327static const struct limits limits_tbl[] = { 327static const struct limits limits_tbl[] ALIGN2 = {
328 { RLIMIT_CORE, 9, }, // -c 328 { RLIMIT_CORE, 9, }, // -c
329 { RLIMIT_DATA, 10, }, // -d 329 { RLIMIT_DATA, 10, }, // -d
330 { RLIMIT_NICE, 0, }, // -e 330 { RLIMIT_NICE, 0, }, // -e