diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-11-30 13:03:03 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-11-30 13:03:03 +0100 |
commit | 965b795b87c59ed45cc7f16a62301dbae65b1627 (patch) | |
tree | 958e486f4f23177746ddee11913d3b59ff4e7f8e /miscutils | |
parent | 2fba2f5bb99145eaa1635fe5a162426158d56a2c (diff) | |
download | busybox-965b795b87c59ed45cc7f16a62301dbae65b1627.tar.gz |
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 'miscutils')
-rw-r--r-- | miscutils/crond.c | 2 | ||||
-rw-r--r-- | miscutils/dc.c | 2 | ||||
-rw-r--r-- | miscutils/hdparm.c | 2 | ||||
-rw-r--r-- | miscutils/i2c_tools.c | 15 | ||||
-rw-r--r-- | miscutils/mt.c | 2 | ||||
-rw-r--r-- | miscutils/setserial.c | 3 | ||||
-rw-r--r-- | miscutils/ubi_tools.c | 2 | ||||
-rw-r--r-- | miscutils/watchdog.c | 2 |
8 files changed, 12 insertions, 18 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c index 2e8ca8b68..fb3adc180 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -492,7 +492,7 @@ static void load_crontab(const char *fileName) const char *name; const char tokens[8]; } SpecialEntry; - static const SpecialEntry SpecAry[] = { + static const SpecialEntry SpecAry[] ALIGN8 = { /* hour day month weekday */ { "yearly", "0\0" "1\0" "1\0" "*" }, { "annually", "0\0" "1\0" "1\0" "*" }, diff --git a/miscutils/dc.c b/miscutils/dc.c index ef93c20ba..51376dd75 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -195,7 +195,7 @@ struct op { void (*function) (void); }; -static const struct op operators[] = { +static const struct op operators[] ALIGN_PTR = { #if ENABLE_FEATURE_DC_LIBM {"^", power}, // {"exp", power}, diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 431a0ad96..01b4e8e2e 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -1366,7 +1366,7 @@ static NOINLINE void dump_identity(const struct hd_driveid *id) } if (id->capability & 1) { if (id->dma_1word | id->dma_mword) { - static const int dma_wmode_masks[] = { 0x100, 1, 0x200, 2, 0x400, 4, 0xf800, 0xf8 }; + static const int dma_wmode_masks[] ALIGN4 = { 0x100, 1, 0x200, 2, 0x400, 4, 0xf800, 0xf8 }; printf("\n DMA modes: "); print_flags_separated(dma_wmode_masks, "*\0""sdma0 \0""*\0""sdma1 \0""*\0""sdma2 \0""*\0""sdma? \0", diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index cc8b99a92..09364e396 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c @@ -1053,18 +1053,13 @@ struct adap_desc { }; static const struct adap_desc adap_descs[] = { - { .funcs = "dummy", - .algo = "Dummy bus", }, - { .funcs = "isa", - .algo = "ISA bus", }, - { .funcs = "i2c", - .algo = "I2C adapter", }, - { .funcs = "smbus", - .algo = "SMBus adapter", }, + { .funcs = "dummy", .algo = "Dummy bus", }, + { .funcs = "isa", .algo = "ISA bus", }, + { .funcs = "i2c", .algo = "I2C adapter", }, + { .funcs = "smbus", .algo = "SMBus adapter", }, }; -struct i2c_func -{ +struct i2c_func { long value; const char* name; }; diff --git a/miscutils/mt.c b/miscutils/mt.c index 9f1aecfca..dbb8c13ad 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -30,7 +30,7 @@ #include <sys/mtio.h> /* missing: eod/seod, stoptions, stwrthreshold, densities */ -static const short opcode_value[] = { +static const short opcode_value[] ALIGN2 = { MTBSF, MTBSFM, MTBSR, diff --git a/miscutils/setserial.c b/miscutils/setserial.c index 1e75bf433..2006861e2 100644 --- a/miscutils/setserial.c +++ b/miscutils/setserial.c @@ -381,8 +381,7 @@ static bool cmd_needs_arg(int cmd) # error "Unexpected flags size" #endif -static const uint16_t setbits[CMD_FLAG_LAST + 1] = -{ +static const uint16_t setbits[CMD_FLAG_LAST + 1] ALIGN2 = { 0, ASYNC_SPD_HI, ASYNC_SPD_VHI, diff --git a/miscutils/ubi_tools.c b/miscutils/ubi_tools.c index 94a637eee..69ead7a13 100644 --- a/miscutils/ubi_tools.c +++ b/miscutils/ubi_tools.c @@ -97,7 +97,7 @@ static unsigned get_num_from_file(const char *path, unsigned max) int ubi_tools_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int ubi_tools_main(int argc UNUSED_PARAM, char **argv) { - static const struct suffix_mult size_suffixes[] = { + static const struct suffix_mult size_suffixes[] ALIGN_SUFFIX = { { "KiB", 1024 }, { "MiB", 1024*1024 }, { "GiB", 1024*1024*1024 }, diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 971b777a3..0ed10bcf1 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -88,7 +88,7 @@ int watchdog_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int watchdog_main(int argc UNUSED_PARAM, char **argv) { static const int enable = WDIOS_ENABLECARD; - static const struct suffix_mult suffixes[] = { + static const struct suffix_mult suffixes[] ALIGN_SUFFIX = { { "ms", 1 }, { "", 1000 }, { "", 0 } |