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>
This commit is contained in:
Denys Vlasenko
2020-11-30 13:03:03 +01:00
parent 2fba2f5bb9
commit 965b795b87
51 changed files with 92 additions and 96 deletions

View File

@ -99,7 +99,7 @@ struct acpi_event {
const char *desc;
};
static const struct acpi_event f_evt_tab[] = {
static const struct acpi_event f_evt_tab[] ALIGN_PTR = {
{ "EV_KEY", 0x01, "KEY_POWER", 116, 1, "button/power PWRF 00000080" },
{ "EV_KEY", 0x01, "KEY_POWER", 116, 1, "button/power PWRB 00000080" },
{ "EV_SW", 0x05, "SW_LID", 0x00, 1, "button/lid LID0 00000080" },
@ -110,7 +110,7 @@ struct acpi_action {
const char *action;
};
static const struct acpi_action f_act_tab[] = {
static const struct acpi_action f_act_tab[] ALIGN_PTR = {
{ "PWRF", "PWRF/00000080" },
{ "LID0", "LID/00000080" },
};

View File

@ -193,7 +193,7 @@ static const struct cmdoptions_t {
const char name[9];
const unsigned char param_count;
const unsigned char code;
} g_cmdoptions[] = {
} g_cmdoptions[] ALIGN1 = {
/*"12345678" + NUL */
//TODO: convert to index_in_strings()
{ "fb" , 1, CMD_FB },

View File

@ -303,7 +303,7 @@ static sector_t get_nr_sects(const struct partition *p);
/* DOS partition types */
static const char *const i386_sys_types[] = {
static const char *const i386_sys_types[] ALIGN_PTR = {
"\x00" "Empty",
"\x01" "FAT12",
"\x04" "FAT16 <32M",

View File

@ -144,7 +144,7 @@ struct xbsd_disklabel {
#define BSD_DSTYPE_DOSPART(s) ((s) & 3) /* dos partition number */
#define BSD_DSTYPE_GEOMETRY 0x10 /* drive params in label */
static const char *const xbsd_dktypenames[] = {
static const char *const xbsd_dktypenames[] ALIGN_PTR = {
"unknown",
"SMD",
"MSCP",
@ -190,7 +190,7 @@ static const char *const xbsd_dktypenames[] = {
#define BSD_FS_MSDOS 8 /* MS-DOS file system */
#endif
static const char *const xbsd_fstypes[] = {
static const char *const xbsd_fstypes[] ALIGN_PTR = {
"\x00" "unused", /* BSD_FS_UNUSED */
"\x01" "swap", /* BSD_FS_SWAP */
"\x02" "Version 6", /* BSD_FS_V6 */

View File

@ -174,7 +174,7 @@ isinfreelist(unsigned int b)
* end of free blocks section
*/
static const char *const sgi_sys_types[] = {
static const char *const sgi_sys_types[] ALIGN_PTR = {
/* SGI_VOLHDR */ "\x00" "SGI volhdr" ,
/* 0x01 */ "\x01" "SGI trkrepl" ,
/* 0x02 */ "\x02" "SGI secrepl" ,

View File

@ -61,7 +61,7 @@ guess_device_type(void)
}
}
static const char *const sun_sys_types[] = {
static const char *const sun_sys_types[] ALIGN_PTR = {
"\x00" "Empty" , /* 0 */
"\x01" "Boot" , /* 1 */
"\x02" "SunOS root" , /* 2 */
@ -133,7 +133,7 @@ static const struct sun_predefined_drives {
unsigned short ntrks;
unsigned short nsect;
unsigned short rspeed;
} sun_drives[] = {
} sun_drives[] ALIGN_PTR = {
{ "Quantum","ProDrive 80S",1,832,2,834,6,34,3662},
{ "Quantum","ProDrive 105S",1,974,2,1019,6,35,3662},
{ "CDC","Wren IV 94171-344",3,1545,2,1549,9,46,3600},

View File

@ -131,7 +131,7 @@ static void allocate(uint8_t *bitmap, uint32_t blocksize, uint32_t start, uint32
static uint32_t has_super(uint32_t x)
{
// 0, 1 and powers of 3, 5, 7 up to 2^32 limit
static const uint32_t supers[] = {
static const uint32_t supers[] ALIGN4 = {
0, 1, 3, 5, 7, 9, 25, 27, 49, 81, 125, 243, 343, 625, 729,
2187, 2401, 3125, 6561, 15625, 16807, 19683, 59049, 78125,
117649, 177147, 390625, 531441, 823543, 1594323, 1953125,

View File

@ -323,7 +323,7 @@ enum {
// Standard mount options (from -o options or --options),
// with corresponding flags
static const int32_t mount_options[] = {
static const int32_t mount_options[] ALIGN4 = {
// MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs.
IF_FEATURE_MOUNT_LOOP(

View File

@ -49,7 +49,7 @@
typedef int FAST_FUNC (*raid_probe_fptr)(struct volume_id *id, /*uint64_t off,*/ uint64_t size);
typedef int FAST_FUNC (*probe_fptr)(struct volume_id *id /*, uint64_t off*/);
static const raid_probe_fptr raid1[] = {
static const raid_probe_fptr raid1[] ALIGN_PTR = {
#if ENABLE_FEATURE_VOLUMEID_LINUXRAID
volume_id_probe_linux_raid,
#endif
@ -76,7 +76,7 @@ static const raid_probe_fptr raid1[] = {
#endif
};
static const probe_fptr raid2[] = {
static const probe_fptr raid2[] ALIGN_PTR = {
#if ENABLE_FEATURE_VOLUMEID_LVM
volume_id_probe_lvm1,
volume_id_probe_lvm2,
@ -90,7 +90,7 @@ static const probe_fptr raid2[] = {
};
/* signature in the first block, only small buffer needed */
static const probe_fptr fs1[] = {
static const probe_fptr fs1[] ALIGN_PTR = {
#if ENABLE_FEATURE_VOLUMEID_FAT
volume_id_probe_vfat,
#endif
@ -118,7 +118,7 @@ static const probe_fptr fs1[] = {
};
/* fill buffer with maximum */
static const probe_fptr fs2[] = {
static const probe_fptr fs2[] ALIGN_PTR = {
#if ENABLE_FEATURE_VOLUMEID_LINUXSWAP
volume_id_probe_linux_swap,
#endif