aboutsummaryrefslogtreecommitdiff
path: root/libbb
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 /libbb
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 'libbb')
-rw-r--r--libbb/capability.c2
-rw-r--r--libbb/duration.c2
-rw-r--r--libbb/hash_md5_sha.c22
-rw-r--r--libbb/mode_string.c2
-rw-r--r--libbb/pw_encrypt_des.c15
-rw-r--r--libbb/speed_table.c2
-rw-r--r--libbb/xatonum.c6
7 files changed, 25 insertions, 26 deletions
diff --git a/libbb/capability.c b/libbb/capability.c
index 23afd8eb9..e3c252a5a 100644
--- a/libbb/capability.c
+++ b/libbb/capability.c
@@ -17,7 +17,7 @@ extern int capget(cap_user_header_t header, const cap_user_data_t data);
17// This way, libcap needs not be installed in build environment. 17// This way, libcap needs not be installed in build environment.
18#include "libbb.h" 18#include "libbb.h"
19 19
20static const char *const capabilities[] = { 20static const char *const capabilities[] ALIGN_PTR = {
21 "chown", 21 "chown",
22 "dac_override", 22 "dac_override",
23 "dac_read_search", 23 "dac_read_search",
diff --git a/libbb/duration.c b/libbb/duration.c
index 22b209f4d..086da15fb 100644
--- a/libbb/duration.c
+++ b/libbb/duration.c
@@ -21,7 +21,7 @@
21 21
22#include "libbb.h" 22#include "libbb.h"
23 23
24static const struct suffix_mult duration_suffixes[] = { 24static const struct suffix_mult duration_suffixes[] ALIGN_SUFFIX = {
25 { "s", 1 }, 25 { "s", 1 },
26 { "m", 60 }, 26 { "m", 60 },
27 { "h", 60*60 }, 27 { "h", 60*60 },
diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
index d8f210173..e0db8ce67 100644
--- a/libbb/hash_md5_sha.c
+++ b/libbb/hash_md5_sha.c
@@ -111,7 +111,7 @@ static void FAST_FUNC md5_process_block64(md5_ctx_t *ctx)
111 They are defined in RFC 1321 as 111 They are defined in RFC 1321 as
112 T[i] = (int)(2^32 * fabs(sin(i))), i=1..64 112 T[i] = (int)(2^32 * fabs(sin(i))), i=1..64
113 */ 113 */
114 static const uint32_t C_array[] = { 114 static const uint32_t C_array[] ALIGN4 = {
115 /* round 1 */ 115 /* round 1 */
116 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 116 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
117 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 117 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
@@ -492,7 +492,7 @@ unsigned FAST_FUNC md5_end(md5_ctx_t *ctx, void *resbuf)
492 492
493static void FAST_FUNC sha1_process_block64(sha1_ctx_t *ctx) 493static void FAST_FUNC sha1_process_block64(sha1_ctx_t *ctx)
494{ 494{
495 static const uint32_t rconsts[] = { 495 static const uint32_t rconsts[] ALIGN4 = {
496 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 496 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6
497 }; 497 };
498 int i, j; 498 int i, j;
@@ -567,7 +567,7 @@ typedef uint64_t sha_K_int;
567typedef uint32_t sha_K_int; 567typedef uint32_t sha_K_int;
568# define K(v) (uint32_t)(v >> 32) 568# define K(v) (uint32_t)(v >> 32)
569#endif 569#endif
570static const sha_K_int sha_K[] = { 570static const sha_K_int sha_K[] ALIGN8 = {
571 K(0x428a2f98d728ae22ULL), K(0x7137449123ef65cdULL), 571 K(0x428a2f98d728ae22ULL), K(0x7137449123ef65cdULL),
572 K(0xb5c0fbcfec4d3b2fULL), K(0xe9b5dba58189dbbcULL), 572 K(0xb5c0fbcfec4d3b2fULL), K(0xe9b5dba58189dbbcULL),
573 K(0x3956c25bf348b538ULL), K(0x59f111f1b605d019ULL), 573 K(0x3956c25bf348b538ULL), K(0x59f111f1b605d019ULL),
@@ -760,7 +760,7 @@ void FAST_FUNC sha1_begin(sha1_ctx_t *ctx)
760 ctx->process_block = sha1_process_block64; 760 ctx->process_block = sha1_process_block64;
761} 761}
762 762
763static const uint32_t init256[] = { 763static const uint32_t init256[] ALIGN4 = {
764 0, 764 0,
765 0, 765 0,
766 0x6a09e667, 766 0x6a09e667,
@@ -773,7 +773,7 @@ static const uint32_t init256[] = {
773 0x5be0cd19, 773 0x5be0cd19,
774}; 774};
775#if NEED_SHA512 775#if NEED_SHA512
776static const uint32_t init512_lo[] = { 776static const uint32_t init512_lo[] ALIGN4 = {
777 0, 777 0,
778 0, 778 0,
779 0xf3bcc908, 779 0xf3bcc908,
@@ -1009,7 +1009,7 @@ static void sha3_process_block72(uint64_t *state)
1009 1009
1010#if OPTIMIZE_SHA3_FOR_32 1010#if OPTIMIZE_SHA3_FOR_32
1011 /* 1011 /*
1012 static const uint32_t IOTA_CONST_0[NROUNDS] = { 1012 static const uint32_t IOTA_CONST_0[NROUNDS] ALIGN4 = {
1013 0x00000001UL, 1013 0x00000001UL,
1014 0x00000000UL, 1014 0x00000000UL,
1015 0x00000000UL, 1015 0x00000000UL,
@@ -1038,7 +1038,7 @@ static void sha3_process_block72(uint64_t *state)
1038 ** bits are in lsb: 0101 0000 1111 0100 1111 0001 1038 ** bits are in lsb: 0101 0000 1111 0100 1111 0001
1039 */ 1039 */
1040 uint32_t IOTA_CONST_0bits = (uint32_t)(0x0050f4f1); 1040 uint32_t IOTA_CONST_0bits = (uint32_t)(0x0050f4f1);
1041 static const uint32_t IOTA_CONST_1[NROUNDS] = { 1041 static const uint32_t IOTA_CONST_1[NROUNDS] ALIGN4 = {
1042 0x00000000UL, 1042 0x00000000UL,
1043 0x00000089UL, 1043 0x00000089UL,
1044 0x8000008bUL, 1044 0x8000008bUL,
@@ -1174,7 +1174,7 @@ static void sha3_process_block72(uint64_t *state)
1174 combine_halves(state); 1174 combine_halves(state);
1175#else 1175#else
1176 /* Native 64-bit algorithm */ 1176 /* Native 64-bit algorithm */
1177 static const uint16_t IOTA_CONST[NROUNDS] = { 1177 static const uint16_t IOTA_CONST[NROUNDS] ALIGN2 = {
1178 /* Elements should be 64-bit, but top half is always zero 1178 /* Elements should be 64-bit, but top half is always zero
1179 * or 0x80000000. We encode 63rd bits in a separate word below. 1179 * or 0x80000000. We encode 63rd bits in a separate word below.
1180 * Same is true for 31th bits, which lets us use 16-bit table 1180 * Same is true for 31th bits, which lets us use 16-bit table
@@ -1210,15 +1210,15 @@ static void sha3_process_block72(uint64_t *state)
1210 /* bit for CONST[0] is in msb: 0001 0110 0011 1000 0001 1011 */ 1210 /* bit for CONST[0] is in msb: 0001 0110 0011 1000 0001 1011 */
1211 const uint32_t IOTA_CONST_bit31 = (uint32_t)(0x16381b00); 1211 const uint32_t IOTA_CONST_bit31 = (uint32_t)(0x16381b00);
1212 1212
1213 static const uint8_t ROT_CONST[24] = { 1213 static const uint8_t ROT_CONST[24] ALIGN1 = {
1214 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, 1214 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14,
1215 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44, 1215 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44,
1216 }; 1216 };
1217 static const uint8_t PI_LANE[24] = { 1217 static const uint8_t PI_LANE[24] ALIGN1 = {
1218 10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4, 1218 10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4,
1219 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1, 1219 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1,
1220 }; 1220 };
1221 /*static const uint8_t MOD5[10] = { 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, };*/ 1221 /*static const uint8_t MOD5[10] ALIGN1 = { 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, };*/
1222 1222
1223 unsigned x; 1223 unsigned x;
1224 unsigned round; 1224 unsigned round;
diff --git a/libbb/mode_string.c b/libbb/mode_string.c
index 5ffd5683e..9a286f3ff 100644
--- a/libbb/mode_string.c
+++ b/libbb/mode_string.c
@@ -27,7 +27,7 @@
27#define mode_t unsigned short 27#define mode_t unsigned short
28#endif 28#endif
29 29
30static const mode_t mode_flags[] = { 30static const mode_t mode_flags[] ALIGN4 = {
31 S_IRUSR, S_IWUSR, S_IXUSR, S_ISUID, 31 S_IRUSR, S_IWUSR, S_IXUSR, S_ISUID,
32 S_IRGRP, S_IWGRP, S_IXGRP, S_ISGID, 32 S_IRGRP, S_IWGRP, S_IXGRP, S_ISGID,
33 S_IROTH, S_IWOTH, S_IXOTH, S_ISVTX 33 S_IROTH, S_IWOTH, S_IXOTH, S_ISVTX
diff --git a/libbb/pw_encrypt_des.c b/libbb/pw_encrypt_des.c
index 19a9ab15b..c6fc328d8 100644
--- a/libbb/pw_encrypt_des.c
+++ b/libbb/pw_encrypt_des.c
@@ -65,25 +65,25 @@
65 65
66 66
67/* A pile of data */ 67/* A pile of data */
68static const uint8_t IP[64] = { 68static const uint8_t IP[64] ALIGN1 = {
69 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 69 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4,
70 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 70 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8,
71 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 71 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3,
72 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 72 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7
73}; 73};
74 74
75static const uint8_t key_perm[56] = { 75static const uint8_t key_perm[56] ALIGN1 = {
76 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 76 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18,
77 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 77 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36,
78 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 78 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22,
79 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4 79 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4
80}; 80};
81 81
82static const uint8_t key_shifts[16] = { 82static const uint8_t key_shifts[16] ALIGN1 = {
83 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 83 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
84}; 84};
85 85
86static const uint8_t comp_perm[48] = { 86static const uint8_t comp_perm[48] ALIGN1 = {
87 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 87 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10,
88 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 88 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2,
89 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 89 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48,
@@ -181,13 +181,12 @@ static const uint8_t u_sbox[8][32] = {
181}; 181};
182#endif 182#endif
183 183
184static const uint8_t pbox[32] = { 184static const uint8_t pbox[32] ALIGN1 = {
185 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 185 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10,
186 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 186 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25
187}; 187};
188 188
189static const uint32_t bits32[32] = 189static const uint32_t bits32[32] ALIGN4 = {
190{
191 0x80000000, 0x40000000, 0x20000000, 0x10000000, 190 0x80000000, 0x40000000, 0x20000000, 0x10000000,
192 0x08000000, 0x04000000, 0x02000000, 0x01000000, 191 0x08000000, 0x04000000, 0x02000000, 0x01000000,
193 0x00800000, 0x00400000, 0x00200000, 0x00100000, 192 0x00800000, 0x00400000, 0x00200000, 0x00100000,
@@ -198,7 +197,7 @@ static const uint32_t bits32[32] =
198 0x00000008, 0x00000004, 0x00000002, 0x00000001 197 0x00000008, 0x00000004, 0x00000002, 0x00000001
199}; 198};
200 199
201static const uint8_t bits8[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; 200static const uint8_t bits8[8] ALIGN1 = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
202 201
203 202
204static int 203static int
diff --git a/libbb/speed_table.c b/libbb/speed_table.c
index 967cf8de8..cf7101e64 100644
--- a/libbb/speed_table.c
+++ b/libbb/speed_table.c
@@ -28,7 +28,7 @@ struct speed_map {
28}; 28};
29 29
30/* On Linux, Bxx constants are 0..15 (up to B38400) and 0x1001..0x100f */ 30/* On Linux, Bxx constants are 0..15 (up to B38400) and 0x1001..0x100f */
31static const struct speed_map speeds[] = { 31static const struct speed_map speeds[] ALIGN4 = {
32 {B0, 0}, 32 {B0, 0},
33 {B50, 50}, 33 {B50, 50},
34 {B75, 75}, 34 {B75, 75},
diff --git a/libbb/xatonum.c b/libbb/xatonum.c
index 7639a62aa..36b06c849 100644
--- a/libbb/xatonum.c
+++ b/libbb/xatonum.c
@@ -68,14 +68,14 @@ uint16_t FAST_FUNC xatou16(const char *numstr)
68 return xatou_range(numstr, 0, 0xffff); 68 return xatou_range(numstr, 0, 0xffff);
69} 69}
70 70
71const struct suffix_mult bkm_suffixes[] = { 71const struct suffix_mult bkm_suffixes[] ALIGN_SUFFIX = {
72 { "b", 512 }, 72 { "b", 512 },
73 { "k", 1024 }, 73 { "k", 1024 },
74 { "m", 1024*1024 }, 74 { "m", 1024*1024 },
75 { "", 0 } 75 { "", 0 }
76}; 76};
77 77
78const struct suffix_mult cwbkMG_suffixes[] = { 78const struct suffix_mult cwbkMG_suffixes[] ALIGN_SUFFIX = {
79 { "c", 1 }, 79 { "c", 1 },
80 { "w", 2 }, 80 { "w", 2 },
81 { "b", 512 }, 81 { "b", 512 },
@@ -96,7 +96,7 @@ const struct suffix_mult cwbkMG_suffixes[] = {
96 { "", 0 } 96 { "", 0 }
97}; 97};
98 98
99const struct suffix_mult kmg_i_suffixes[] = { 99const struct suffix_mult kmg_i_suffixes[] ALIGN_SUFFIX = {
100 { "KiB", 1024 }, 100 { "KiB", 1024 },
101 { "kiB", 1024 }, 101 { "kiB", 1024 },
102 { "K", 1024 }, 102 { "K", 1024 },