diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-12 20:58:27 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-08-12 20:58:27 +0000 |
commit | 6ca409e0e4c198fe3081346eebbae3f068fe605a (patch) | |
tree | 060cb05d99220a1eda399194d1209c269f0e8cd8 /coreutils/od_bloaty.c | |
parent | 4185548984357df91311f30c8e43d95f33922576 (diff) | |
download | busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2 busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip |
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts
size saving: 0.5k
Diffstat (limited to 'coreutils/od_bloaty.c')
-rw-r--r-- | coreutils/od_bloaty.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index e30860544..d3c9f9a17 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c | |||
@@ -129,20 +129,20 @@ struct tspec { | |||
129 | 10 unsigned decimal | 129 | 10 unsigned decimal |
130 | 8 unsigned hexadecimal */ | 130 | 8 unsigned hexadecimal */ |
131 | 131 | ||
132 | static const uint8_t bytes_to_oct_digits[] = | 132 | static const uint8_t bytes_to_oct_digits[] ALIGN1 = |
133 | {0, 3, 6, 8, 11, 14, 16, 19, 22, 25, 27, 30, 32, 35, 38, 41, 43}; | 133 | {0, 3, 6, 8, 11, 14, 16, 19, 22, 25, 27, 30, 32, 35, 38, 41, 43}; |
134 | 134 | ||
135 | static const uint8_t bytes_to_signed_dec_digits[] = | 135 | static const uint8_t bytes_to_signed_dec_digits[] ALIGN1 = |
136 | {1, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 28, 30, 33, 35, 37, 40}; | 136 | {1, 4, 6, 8, 11, 13, 16, 18, 20, 23, 25, 28, 30, 33, 35, 37, 40}; |
137 | 137 | ||
138 | static const uint8_t bytes_to_unsigned_dec_digits[] = | 138 | static const uint8_t bytes_to_unsigned_dec_digits[] ALIGN1 = |
139 | {0, 3, 5, 8, 10, 13, 15, 17, 20, 22, 25, 27, 29, 32, 34, 37, 39}; | 139 | {0, 3, 5, 8, 10, 13, 15, 17, 20, 22, 25, 27, 29, 32, 34, 37, 39}; |
140 | 140 | ||
141 | static const uint8_t bytes_to_hex_digits[] = | 141 | static const uint8_t bytes_to_hex_digits[] ALIGN1 = |
142 | {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32}; | 142 | {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32}; |
143 | 143 | ||
144 | /* Convert enum size_spec to the size of the named type. */ | 144 | /* Convert enum size_spec to the size of the named type. */ |
145 | static const signed char width_bytes[] = { | 145 | static const signed char width_bytes[] ALIGN1 = { |
146 | -1, | 146 | -1, |
147 | sizeof(char), | 147 | sizeof(char), |
148 | sizeof(short), | 148 | sizeof(short), |
@@ -212,7 +212,7 @@ static char const *const default_file_list[] = { "-", NULL }; | |||
212 | static FILE *in_stream; | 212 | static FILE *in_stream; |
213 | 213 | ||
214 | #define MAX_INTEGRAL_TYPE_SIZE sizeof(ulonglong_t) | 214 | #define MAX_INTEGRAL_TYPE_SIZE sizeof(ulonglong_t) |
215 | static unsigned char integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1] = { | 215 | static unsigned char integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1] ALIGN1 = { |
216 | [sizeof(char)] = CHAR, | 216 | [sizeof(char)] = CHAR, |
217 | #if USHRT_MAX != UCHAR_MAX | 217 | #if USHRT_MAX != UCHAR_MAX |
218 | [sizeof(short)] = SHORT, | 218 | [sizeof(short)] = SHORT, |
@@ -229,11 +229,11 @@ static unsigned char integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1] = { | |||
229 | }; | 229 | }; |
230 | 230 | ||
231 | #define MAX_FP_TYPE_SIZE sizeof(longdouble_t) | 231 | #define MAX_FP_TYPE_SIZE sizeof(longdouble_t) |
232 | static unsigned char fp_type_size[MAX_FP_TYPE_SIZE + 1] = { | 232 | static unsigned char fp_type_size[MAX_FP_TYPE_SIZE + 1] ALIGN1 = { |
233 | /* gcc seems to allow repeated indexes. Last one stays */ | 233 | /* gcc seems to allow repeated indexes. Last one stays */ |
234 | [sizeof(longdouble_t)] = FLOAT_LONG_DOUBLE, | 234 | [sizeof(longdouble_t)] = FLOAT_LONG_DOUBLE, |
235 | [sizeof(double)] = FLOAT_DOUBLE, | 235 | [sizeof(double)] = FLOAT_DOUBLE, |
236 | [sizeof(float)] = FLOAT_SINGLE, | 236 | [sizeof(float)] = FLOAT_SINGLE |
237 | }; | 237 | }; |
238 | 238 | ||
239 | 239 | ||
@@ -383,7 +383,7 @@ print_named_ascii(size_t n_bytes, const char *block, | |||
383 | const char *unused_fmt_string ATTRIBUTE_UNUSED) | 383 | const char *unused_fmt_string ATTRIBUTE_UNUSED) |
384 | { | 384 | { |
385 | /* Names for some non-printing characters. */ | 385 | /* Names for some non-printing characters. */ |
386 | static const char charname[33][3] = { | 386 | static const char charname[33][3] ALIGN1 = { |
387 | "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", | 387 | "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", |
388 | " bs", " ht", " nl", " vt", " ff", " cr", " so", " si", | 388 | " bs", " ht", " nl", " vt", " ff", " cr", " so", " si", |
389 | "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", | 389 | "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", |
@@ -560,7 +560,7 @@ decode_one_format(const char *s_orig, const char *s, const char **next, | |||
560 | case 'o': | 560 | case 'o': |
561 | case 'u': | 561 | case 'u': |
562 | case 'x': { | 562 | case 'x': { |
563 | static const char CSIL[] = "CSIL"; | 563 | static const char CSIL[] ALIGN1 = "CSIL"; |
564 | 564 | ||
565 | c = *s++; | 565 | c = *s++; |
566 | p = strchr(CSIL, *s); | 566 | p = strchr(CSIL, *s); |
@@ -596,7 +596,7 @@ decode_one_format(const char *s_orig, const char *s, const char **next, | |||
596 | size_spec = integral_type_size[size]; | 596 | size_spec = integral_type_size[size]; |
597 | 597 | ||
598 | { | 598 | { |
599 | static const char doux[] = "doux"; | 599 | static const char doux[] ALIGN1 = "doux"; |
600 | static const char doux_fmt_letter[][4] = { | 600 | static const char doux_fmt_letter[][4] = { |
601 | "lld", "llo", "llu", "llx" | 601 | "lld", "llo", "llu", "llx" |
602 | }; | 602 | }; |
@@ -653,7 +653,7 @@ decode_one_format(const char *s_orig, const char *s, const char **next, | |||
653 | } | 653 | } |
654 | 654 | ||
655 | case 'f': { | 655 | case 'f': { |
656 | static const char FDL[] = "FDL"; | 656 | static const char FDL[] ALIGN1 = "FDL"; |
657 | 657 | ||
658 | fmt = FLOATING_POINT; | 658 | fmt = FLOATING_POINT; |
659 | ++s; | 659 | ++s; |
@@ -836,7 +836,7 @@ format_address_none(off_t address ATTRIBUTE_UNUSED, char c ATTRIBUTE_UNUSED) | |||
836 | { | 836 | { |
837 | } | 837 | } |
838 | 838 | ||
839 | static char address_fmt[] = "%0n"OFF_FMT"xc"; | 839 | static char address_fmt[] ALIGN1 = "%0n"OFF_FMT"xc"; |
840 | /* Corresponds to 'x' above */ | 840 | /* Corresponds to 'x' above */ |
841 | #define address_base_char address_fmt[sizeof(address_fmt)-3] | 841 | #define address_base_char address_fmt[sizeof(address_fmt)-3] |
842 | /* Corresponds to 'n' above */ | 842 | /* Corresponds to 'n' above */ |
@@ -1233,7 +1233,7 @@ int od_main(int argc, char **argv) | |||
1233 | OPT_traditional = (1 << 18) * ENABLE_GETOPT_LONG, | 1233 | OPT_traditional = (1 << 18) * ENABLE_GETOPT_LONG, |
1234 | }; | 1234 | }; |
1235 | #if ENABLE_GETOPT_LONG | 1235 | #if ENABLE_GETOPT_LONG |
1236 | static const char od_longopts[] = | 1236 | static const char od_longopts[] ALIGN1 = |
1237 | "skip-bytes\0" Required_argument "j" | 1237 | "skip-bytes\0" Required_argument "j" |
1238 | "address-radix\0" Required_argument "A" | 1238 | "address-radix\0" Required_argument "A" |
1239 | "read-bytes\0" Required_argument "N" | 1239 | "read-bytes\0" Required_argument "N" |
@@ -1268,11 +1268,11 @@ int od_main(int argc, char **argv) | |||
1268 | argc -= optind; | 1268 | argc -= optind; |
1269 | argv += optind; | 1269 | argv += optind; |
1270 | if (opt & OPT_A) { | 1270 | if (opt & OPT_A) { |
1271 | static const char doxn[] = "doxn"; | 1271 | static const char doxn[] ALIGN1 = "doxn"; |
1272 | static const char doxn_address_base_char[] = { | 1272 | static const char doxn_address_base_char[] ALIGN1 = { |
1273 | 'u', 'o', 'x', /* '?' fourth one is not important */ | 1273 | 'u', 'o', 'x', /* '?' fourth one is not important */ |
1274 | }; | 1274 | }; |
1275 | static const uint8_t doxn_address_pad_len_char[] = { | 1275 | static const uint8_t doxn_address_pad_len_char[] ALIGN1 = { |
1276 | '7', '7', '6', /* '?' */ | 1276 | '7', '7', '6', /* '?' */ |
1277 | }; | 1277 | }; |
1278 | char *p; | 1278 | char *p; |