aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-02-06 19:53:10 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2022-02-06 19:53:10 +0100
commitca466f385ac985a8b3491daa9f326dc480cdee70 (patch)
tree2d0635c1a295f02e354d9a6b94c70d1d3d64ddb0
parent4f40735c87f8292a87c066b3b7099b0be007cf59 (diff)
downloadbusybox-w32-ca466f385ac985a8b3491daa9f326dc480cdee70.tar.gz
busybox-w32-ca466f385ac985a8b3491daa9f326dc480cdee70.tar.bz2
busybox-w32-ca466f385ac985a8b3491daa9f326dc480cdee70.zip
*: slap on a few ALIGN* where appropriate
The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" function old new delta .rodata 108586 108460 -126 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-126) Total: -126 bytes text data bss dec hex filename 970412 4219 1848 976479 ee65f busybox_old 970286 4219 1848 976353 ee5e1 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--console-tools/reset.c2
-rw-r--r--coreutils/od.c2
-rw-r--r--include/platform.h1
-rw-r--r--libbb/appletlib.c2
-rw-r--r--libbb/get_console.c2
-rw-r--r--miscutils/bc.c2
-rw-r--r--miscutils/man.c2
-rw-r--r--networking/ifupdown.c8
-rw-r--r--networking/interface.c6
-rw-r--r--networking/libiproute/ipaddress.c2
-rw-r--r--networking/udhcp/common.c2
-rw-r--r--networking/udhcp/d6_dhcpc.c2
-rw-r--r--shell/ash.c2
-rw-r--r--util-linux/hexdump.c2
-rw-r--r--util-linux/nsenter.c2
-rw-r--r--util-linux/unshare.c2
16 files changed, 21 insertions, 20 deletions
diff --git a/console-tools/reset.c b/console-tools/reset.c
index b3acf69f8..cc04e4fcc 100644
--- a/console-tools/reset.c
+++ b/console-tools/reset.c
@@ -36,7 +36,7 @@ int stty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
36int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 36int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
37int reset_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 37int reset_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
38{ 38{
39 static const char *const args[] = { 39 static const char *const args[] ALIGN_PTR = {
40 "stty", "sane", NULL 40 "stty", "sane", NULL
41 }; 41 };
42 42
diff --git a/coreutils/od.c b/coreutils/od.c
index 9a888dd5f..6f22331e0 100644
--- a/coreutils/od.c
+++ b/coreutils/od.c
@@ -144,7 +144,7 @@ odoffset(dumper_t *dumper, int argc, char ***argvp)
144 } 144 }
145} 145}
146 146
147static const char *const add_strings[] = { 147static const char *const add_strings[] ALIGN_PTR = {
148 "16/1 \"%3_u \" \"\\n\"", /* a */ 148 "16/1 \"%3_u \" \"\\n\"", /* a */
149 "8/2 \" %06o \" \"\\n\"", /* B, o */ 149 "8/2 \" %06o \" \"\\n\"", /* B, o */
150 "16/1 \"%03o \" \"\\n\"", /* b */ 150 "16/1 \"%03o \" \"\\n\"", /* b */
diff --git a/include/platform.h b/include/platform.h
index ad27bb31a..ea0512f36 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -346,6 +346,7 @@ typedef unsigned smalluint;
346# define ALIGN4 346# define ALIGN4
347#endif 347#endif
348#define ALIGN8 __attribute__((aligned(8))) 348#define ALIGN8 __attribute__((aligned(8)))
349#define ALIGN_INT __attribute__((aligned(sizeof(int))))
349#define ALIGN_PTR __attribute__((aligned(sizeof(void*)))) 350#define ALIGN_PTR __attribute__((aligned(sizeof(void*))))
350 351
351/* 352/*
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 03389f541..841b3b873 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -651,7 +651,7 @@ static void check_suid(int applet_no)
651# if ENABLE_FEATURE_INSTALLER 651# if ENABLE_FEATURE_INSTALLER
652static const char usr_bin [] ALIGN1 = "/usr/bin/"; 652static const char usr_bin [] ALIGN1 = "/usr/bin/";
653static const char usr_sbin[] ALIGN1 = "/usr/sbin/"; 653static const char usr_sbin[] ALIGN1 = "/usr/sbin/";
654static const char *const install_dir[] = { 654static const char *const install_dir[] ALIGN_PTR = {
655 &usr_bin [8], /* "/" */ 655 &usr_bin [8], /* "/" */
656 &usr_bin [4], /* "/bin/" */ 656 &usr_bin [4], /* "/bin/" */
657 &usr_sbin[4] /* "/sbin/" */ 657 &usr_sbin[4] /* "/sbin/" */
diff --git a/libbb/get_console.c b/libbb/get_console.c
index 7f2c75332..9044efea1 100644
--- a/libbb/get_console.c
+++ b/libbb/get_console.c
@@ -37,7 +37,7 @@ static int open_a_console(const char *fnam)
37 */ 37 */
38int FAST_FUNC get_console_fd_or_die(void) 38int FAST_FUNC get_console_fd_or_die(void)
39{ 39{
40 static const char *const console_names[] = { 40 static const char *const console_names[] ALIGN_PTR = {
41 DEV_CONSOLE, CURRENT_VC, CURRENT_TTY 41 DEV_CONSOLE, CURRENT_VC, CURRENT_TTY
42 }; 42 };
43 43
diff --git a/miscutils/bc.c b/miscutils/bc.c
index ae370ff55..ab785bbc8 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -6011,7 +6011,7 @@ static BC_STATUS zxc_program_assign(char inst)
6011#endif 6011#endif
6012 6012
6013 if (ib || sc || left->t == XC_RESULT_OBASE) { 6013 if (ib || sc || left->t == XC_RESULT_OBASE) {
6014 static const char *const msg[] = { 6014 static const char *const msg[] ALIGN_PTR = {
6015 "bad ibase; must be [2,16]", //XC_RESULT_IBASE 6015 "bad ibase; must be [2,16]", //XC_RESULT_IBASE
6016 "bad obase; must be [2,"BC_MAX_OBASE_STR"]", //XC_RESULT_OBASE 6016 "bad obase; must be [2,"BC_MAX_OBASE_STR"]", //XC_RESULT_OBASE
6017 "bad scale; must be [0,"BC_MAX_SCALE_STR"]", //XC_RESULT_SCALE 6017 "bad scale; must be [0,"BC_MAX_SCALE_STR"]", //XC_RESULT_SCALE
diff --git a/miscutils/man.c b/miscutils/man.c
index d319e8bba..deaf9e5ab 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
@@ -303,7 +303,7 @@ int man_main(int argc UNUSED_PARAM, char **argv)
303 config_close(parser); 303 config_close(parser);
304 304
305 if (!man_path_list) { 305 if (!man_path_list) {
306 static const char *const mpl[] = { "/usr/man", "/usr/share/man", NULL }; 306 static const char *const mpl[] ALIGN_PTR = { "/usr/man", "/usr/share/man", NULL };
307 man_path_list = (char**)mpl; 307 man_path_list = (char**)mpl;
308 /*count_mp = 2; - not used below anyway */ 308 /*count_mp = 2; - not used below anyway */
309 } 309 }
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 737113dd4..6c4ae27f2 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -532,7 +532,7 @@ static int FAST_FUNC v4tunnel_down(struct interface_defn_t * ifd, execfn * exec)
532} 532}
533# endif 533# endif
534 534
535static const struct method_t methods6[] = { 535static const struct method_t methods6[] ALIGN_PTR = {
536# if ENABLE_FEATURE_IFUPDOWN_IP 536# if ENABLE_FEATURE_IFUPDOWN_IP
537 { "v4tunnel" , v4tunnel_up , v4tunnel_down , }, 537 { "v4tunnel" , v4tunnel_up , v4tunnel_down , },
538# endif 538# endif
@@ -627,7 +627,7 @@ struct dhcp_client_t {
627 const char *stopcmd; 627 const char *stopcmd;
628}; 628};
629 629
630static const struct dhcp_client_t ext_dhcp_clients[] = { 630static const struct dhcp_client_t ext_dhcp_clients[] ALIGN_PTR = {
631 { "dhcpcd", 631 { "dhcpcd",
632 "dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %client%]][[ -l %leasetime%]] %iface%", 632 "dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %client%]][[ -l %leasetime%]] %iface%",
633 "dhcpcd -k %iface%", 633 "dhcpcd -k %iface%",
@@ -774,7 +774,7 @@ static int FAST_FUNC wvdial_down(struct interface_defn_t *ifd, execfn *exec)
774 "-p /var/run/wvdial.%iface% -s 2", ifd, exec); 774 "-p /var/run/wvdial.%iface% -s 2", ifd, exec);
775} 775}
776 776
777static const struct method_t methods[] = { 777static const struct method_t methods[] ALIGN_PTR = {
778 { "manual" , manual_up_down, manual_up_down, }, 778 { "manual" , manual_up_down, manual_up_down, },
779 { "wvdial" , wvdial_up , wvdial_down , }, 779 { "wvdial" , wvdial_up , wvdial_down , },
780 { "ppp" , ppp_up , ppp_down , }, 780 { "ppp" , ppp_up , ppp_down , },
@@ -797,7 +797,7 @@ static int FAST_FUNC link_up_down(struct interface_defn_t *ifd UNUSED_PARAM, exe
797 return 1; 797 return 1;
798} 798}
799 799
800static const struct method_t link_methods[] = { 800static const struct method_t link_methods[] ALIGN_PTR = {
801 { "none", link_up_down, link_up_down } 801 { "none", link_up_down, link_up_down }
802}; 802};
803 803
diff --git a/networking/interface.c b/networking/interface.c
index ea6a2c8a8..6b6c0944a 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -446,13 +446,13 @@ static char *get_name(char name[IFNAMSIZ], char *p)
446 * %n specifiers (even the size of integers may not match). 446 * %n specifiers (even the size of integers may not match).
447 */ 447 */
448#if INT_MAX == LONG_MAX 448#if INT_MAX == LONG_MAX
449static const char *const ss_fmt[] = { 449static const char *const ss_fmt[] ALIGN_PTR = {
450 "%n%llu%u%u%u%u%n%n%n%llu%u%u%u%u%u", 450 "%n%llu%u%u%u%u%n%n%n%llu%u%u%u%u%u",
451 "%llu%llu%u%u%u%u%n%n%llu%llu%u%u%u%u%u", 451 "%llu%llu%u%u%u%u%n%n%llu%llu%u%u%u%u%u",
452 "%llu%llu%u%u%u%u%u%u%llu%llu%u%u%u%u%u%u" 452 "%llu%llu%u%u%u%u%u%u%llu%llu%u%u%u%u%u%u"
453}; 453};
454#else 454#else
455static const char *const ss_fmt[] = { 455static const char *const ss_fmt[] ALIGN_PTR = {
456 "%n%llu%lu%lu%lu%lu%n%n%n%llu%lu%lu%lu%lu%lu", 456 "%n%llu%lu%lu%lu%lu%n%n%n%llu%lu%lu%lu%lu%lu",
457 "%llu%llu%lu%lu%lu%lu%n%n%llu%llu%lu%lu%lu%lu%lu", 457 "%llu%llu%lu%lu%lu%lu%n%n%llu%llu%lu%lu%lu%lu%lu",
458 "%llu%llu%lu%lu%lu%lu%lu%lu%llu%llu%lu%lu%lu%lu%lu%lu" 458 "%llu%llu%lu%lu%lu%lu%lu%lu%llu%llu%lu%lu%lu%lu%lu%lu"
@@ -731,7 +731,7 @@ static const struct hwtype ib_hwtype = {
731#endif 731#endif
732 732
733 733
734static const struct hwtype *const hwtypes[] = { 734static const struct hwtype *const hwtypes[] ALIGN_PTR = {
735 &loop_hwtype, 735 &loop_hwtype,
736 &ether_hwtype, 736 &ether_hwtype,
737 &ppp_hwtype, 737 &ppp_hwtype,
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 17a838411..ecc3848ff 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -58,7 +58,7 @@ typedef struct filter_t filter_t;
58 58
59static void print_link_flags(unsigned flags, unsigned mdown) 59static void print_link_flags(unsigned flags, unsigned mdown)
60{ 60{
61 static const int flag_masks[] = { 61 static const int flag_masks[] ALIGN_INT = {
62 IFF_LOOPBACK, IFF_BROADCAST, IFF_POINTOPOINT, 62 IFF_LOOPBACK, IFF_BROADCAST, IFF_POINTOPOINT,
63 IFF_MULTICAST, IFF_NOARP, IFF_UP, IFF_LOWER_UP }; 63 IFF_MULTICAST, IFF_NOARP, IFF_UP, IFF_LOWER_UP };
64 static const char flag_labels[] ALIGN1 = 64 static const char flag_labels[] ALIGN1 =
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 8e9b93655..ae818db05 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -19,7 +19,7 @@ const uint8_t MAC_BCAST_ADDR[6] ALIGN2 = {
19 * See RFC2132 for more options. 19 * See RFC2132 for more options.
20 * OPTION_REQ: these options are requested by udhcpc (unless -o). 20 * OPTION_REQ: these options are requested by udhcpc (unless -o).
21 */ 21 */
22const struct dhcp_optflag dhcp_optflags[] = { 22const struct dhcp_optflag dhcp_optflags[] ALIGN2 = {
23 /* flags code */ 23 /* flags code */
24 { OPTION_IP | OPTION_REQ, 0x01 }, /* DHCP_SUBNET */ 24 { OPTION_IP | OPTION_REQ, 0x01 }, /* DHCP_SUBNET */
25 { OPTION_S32 , 0x02 }, /* DHCP_TIME_OFFSET */ 25 { OPTION_S32 , 0x02 }, /* DHCP_TIME_OFFSET */
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index 9d2a8f5d3..9fc690315 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -65,7 +65,7 @@
65 65
66/* "struct client_data_t client_data" is in bb_common_bufsiz1 */ 66/* "struct client_data_t client_data" is in bb_common_bufsiz1 */
67 67
68static const struct dhcp_optflag d6_optflags[] = { 68static const struct dhcp_optflag d6_optflags[] ALIGN2 = {
69#if ENABLE_FEATURE_UDHCPC6_RFC3646 69#if ENABLE_FEATURE_UDHCPC6_RFC3646
70 { OPTION_6RD | OPTION_LIST | OPTION_REQ, D6_OPT_DNS_SERVERS }, 70 { OPTION_6RD | OPTION_LIST | OPTION_REQ, D6_OPT_DNS_SERVERS },
71 { OPTION_DNS_STRING | OPTION_LIST | OPTION_REQ, D6_OPT_DOMAIN_LIST }, 71 { OPTION_DNS_STRING | OPTION_LIST | OPTION_REQ, D6_OPT_DOMAIN_LIST },
diff --git a/shell/ash.c b/shell/ash.c
index 55df54bd0..adb0f223a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -313,7 +313,7 @@ typedef long arith_t;
313/* ============ Shell options */ 313/* ============ Shell options */
314 314
315/* If you add/change options hare, update --help text too */ 315/* If you add/change options hare, update --help text too */
316static const char *const optletters_optnames[] = { 316static const char *const optletters_optnames[] ALIGN_PTR = {
317 "e" "errexit", 317 "e" "errexit",
318 "f" "noglob", 318 "f" "noglob",
319/* bash has '-o ignoreeof', but no short synonym -I for it */ 319/* bash has '-o ignoreeof', but no short synonym -I for it */
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 57e7e8db7..307a84803 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -71,7 +71,7 @@ static void bb_dump_addfile(dumper_t *dumper, char *name)
71 fclose(fp); 71 fclose(fp);
72} 72}
73 73
74static const char *const add_strings[] = { 74static const char *const add_strings[] ALIGN_PTR = {
75 "\"%07.7_ax \"16/1 \"%03o \"\"\n\"", /* b */ 75 "\"%07.7_ax \"16/1 \"%03o \"\"\n\"", /* b */
76 "\"%07.7_ax \"16/1 \"%3_c \"\"\n\"", /* c */ 76 "\"%07.7_ax \"16/1 \"%3_c \"\"\n\"", /* c */
77 "\"%07.7_ax \"8/2 \" %05u \"\"\n\"", /* d */ 77 "\"%07.7_ax \"8/2 \" %05u \"\"\n\"", /* d */
diff --git a/util-linux/nsenter.c b/util-linux/nsenter.c
index e6339da2f..1aa045b35 100644
--- a/util-linux/nsenter.c
+++ b/util-linux/nsenter.c
@@ -93,7 +93,7 @@ enum {
93 * The user namespace comes first, so that it is entered first. 93 * The user namespace comes first, so that it is entered first.
94 * This gives an unprivileged user the potential to enter other namespaces. 94 * This gives an unprivileged user the potential to enter other namespaces.
95 */ 95 */
96static const struct namespace_descr ns_list[] = { 96static const struct namespace_descr ns_list[] ALIGN_INT = {
97 { CLONE_NEWUSER, "ns/user", }, 97 { CLONE_NEWUSER, "ns/user", },
98 { CLONE_NEWIPC, "ns/ipc", }, 98 { CLONE_NEWIPC, "ns/ipc", },
99 { CLONE_NEWUTS, "ns/uts", }, 99 { CLONE_NEWUTS, "ns/uts", },
diff --git a/util-linux/unshare.c b/util-linux/unshare.c
index 68ccdd874..06b938074 100644
--- a/util-linux/unshare.c
+++ b/util-linux/unshare.c
@@ -120,7 +120,7 @@ enum {
120 NS_USR_POS, /* OPT_user, NS_USR_POS, and ns_list[] index must match! */ 120 NS_USR_POS, /* OPT_user, NS_USR_POS, and ns_list[] index must match! */
121 NS_COUNT, 121 NS_COUNT,
122}; 122};
123static const struct namespace_descr ns_list[] = { 123static const struct namespace_descr ns_list[] ALIGN_INT = {
124 { CLONE_NEWNS, "mnt" }, 124 { CLONE_NEWNS, "mnt" },
125 { CLONE_NEWUTS, "uts" }, 125 { CLONE_NEWUTS, "uts" },
126 { CLONE_NEWIPC, "ipc" }, 126 { CLONE_NEWIPC, "ipc" },