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 /libbb | |
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 'libbb')
-rw-r--r-- | libbb/compare_string_array.c | 4 | ||||
-rw-r--r-- | libbb/dump.c | 10 | ||||
-rw-r--r-- | libbb/getopt32.c | 2 | ||||
-rw-r--r-- | libbb/human_readable.c | 12 | ||||
-rw-r--r-- | libbb/login.c | 4 | ||||
-rw-r--r-- | libbb/md5.c | 4 | ||||
-rw-r--r-- | libbb/messages.c | 54 | ||||
-rw-r--r-- | libbb/mode_string.c | 4 | ||||
-rw-r--r-- | libbb/mtab_file.c | 2 | ||||
-rw-r--r-- | libbb/parse_mode.c | 4 | ||||
-rw-r--r-- | libbb/process_escape_sequence.c | 2 | ||||
-rw-r--r-- | libbb/uuencode.c | 4 |
12 files changed, 53 insertions, 53 deletions
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c index e873d7cc3..731d3d8c1 100644 --- a/libbb/compare_string_array.c +++ b/libbb/compare_string_array.c | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | /* returns the array index of the string */ | 8 | /* returns the array index of the string */ |
9 | /* (index of first match is returned, or -1) */ | 9 | /* (index of first match is returned, or -1) */ |
10 | int index_in_str_array(const char * const string_array[], const char *key) | 10 | int index_in_str_array(const char *const string_array[], const char *key) |
11 | { | 11 | { |
12 | int i; | 12 | int i; |
13 | 13 | ||
@@ -36,7 +36,7 @@ int index_in_strings(const char *strings, const char *key) | |||
36 | /* returns the array index of the string, even if it matches only a beginning */ | 36 | /* returns the array index of the string, even if it matches only a beginning */ |
37 | /* (index of first match is returned, or -1) */ | 37 | /* (index of first match is returned, or -1) */ |
38 | #ifdef UNUSED | 38 | #ifdef UNUSED |
39 | int index_in_substr_array(const char * const string_array[], const char *key) | 39 | int index_in_substr_array(const char *const string_array[], const char *key) |
40 | { | 40 | { |
41 | int i; | 41 | int i; |
42 | int len = strlen(key); | 42 | int len = strlen(key); |
diff --git a/libbb/dump.c b/libbb/dump.c index 5ddbbaaf6..0d1bb18f2 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -26,12 +26,12 @@ static int exitval; /* final exit value */ | |||
26 | int bb_dump_blocksize; /* data block size */ | 26 | int bb_dump_blocksize; /* data block size */ |
27 | int bb_dump_length = -1; /* max bytes to read */ | 27 | int bb_dump_length = -1; /* max bytes to read */ |
28 | 28 | ||
29 | static const char index_str[] = ".#-+ 0123456789"; | 29 | static const char index_str[] ALIGN1 = ".#-+ 0123456789"; |
30 | 30 | ||
31 | static const char size_conv_str[] = | 31 | static const char size_conv_str[] ALIGN1 = |
32 | "\x1\x4\x4\x4\x4\x4\x4\x8\x8\x8\x8\010cdiouxXeEfgG"; | 32 | "\x1\x4\x4\x4\x4\x4\x4\x8\x8\x8\x8\010cdiouxXeEfgG"; |
33 | 33 | ||
34 | static const char lcc[] = "diouxX"; | 34 | static const char lcc[] ALIGN1 = "diouxX"; |
35 | 35 | ||
36 | int bb_dump_size(FS * fs) | 36 | int bb_dump_size(FS * fs) |
37 | { | 37 | { |
@@ -440,7 +440,7 @@ static void bpad(PR * pr) | |||
440 | while ((*p2++ = *p1++) != 0); | 440 | while ((*p2++ = *p1++) != 0); |
441 | } | 441 | } |
442 | 442 | ||
443 | static const char conv_str[] = | 443 | static const char conv_str[] ALIGN1 = |
444 | "\0\\0\0" | 444 | "\0\\0\0" |
445 | "\007\\a\0" /* \a */ | 445 | "\007\\a\0" /* \a */ |
446 | "\b\\b\0" | 446 | "\b\\b\0" |
@@ -479,7 +479,7 @@ static void conv_c(PR * pr, unsigned char * p) | |||
479 | 479 | ||
480 | static void conv_u(PR * pr, unsigned char * p) | 480 | static void conv_u(PR * pr, unsigned char * p) |
481 | { | 481 | { |
482 | static const char list[] = | 482 | static const char list[] ALIGN1 = |
483 | "nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0" | 483 | "nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0" |
484 | "bs\0_ht\0_lf\0_vt\0_ff\0_cr\0_so\0_si\0_" | 484 | "bs\0_ht\0_lf\0_vt\0_ff\0_cr\0_so\0_si\0_" |
485 | "dle\0dcl\0dc2\0dc3\0dc4\0nak\0syn\0etb\0" | 485 | "dle\0dcl\0dc2\0dc3\0dc4\0nak\0syn\0etb\0" |
diff --git a/libbb/getopt32.c b/libbb/getopt32.c index c7c8cb79c..672d70a0a 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c | |||
@@ -76,7 +76,7 @@ const char *applet_long_options | |||
76 | 76 | ||
77 | This struct allows you to define long options: | 77 | This struct allows you to define long options: |
78 | 78 | ||
79 | static const char applet_longopts[] = | 79 | static const char applet_longopts[] ALIGN1 = |
80 | //"name\0" has_arg val | 80 | //"name\0" has_arg val |
81 | "verbose\0" No_argument "v" | 81 | "verbose\0" No_argument "v" |
82 | ; | 82 | ; |
diff --git a/libbb/human_readable.c b/libbb/human_readable.c index 09fa82c09..d60ef61d7 100644 --- a/libbb/human_readable.c +++ b/libbb/human_readable.c | |||
@@ -31,12 +31,12 @@ | |||
31 | const char *make_human_readable_str(unsigned long long size, | 31 | const char *make_human_readable_str(unsigned long long size, |
32 | unsigned long block_size, unsigned long display_unit) | 32 | unsigned long block_size, unsigned long display_unit) |
33 | { | 33 | { |
34 | /* The code will adjust for additional (appended) units. */ | 34 | /* The code will adjust for additional (appended) units */ |
35 | static const char zero_and_units[] = { '0', 0, 'k', 'M', 'G', 'T' }; | 35 | static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' }; |
36 | static const char fmt[] = "%llu"; | 36 | static const char fmt[] ALIGN1 = "%llu"; |
37 | static const char fmt_tenths[] = "%llu.%d%c"; | 37 | static const char fmt_tenths[] ALIGN1 = "%llu.%d%c"; |
38 | 38 | ||
39 | static char str[21]; /* Sufficient for 64 bit unsigned integers. */ | 39 | static char str[21] ALIGN1; /* Sufficient for 64 bit unsigned integers */ |
40 | 40 | ||
41 | unsigned long long val; | 41 | unsigned long long val; |
42 | int frac; | 42 | int frac; |
@@ -53,7 +53,7 @@ const char *make_human_readable_str(unsigned long long size, | |||
53 | } | 53 | } |
54 | 54 | ||
55 | if (display_unit) { | 55 | if (display_unit) { |
56 | val += display_unit/2; /* Deal with rounding. */ | 56 | val += display_unit/2; /* Deal with rounding */ |
57 | val /= display_unit; /* Don't combine with the line above!!! */ | 57 | val /= display_unit; /* Don't combine with the line above!!! */ |
58 | } else { | 58 | } else { |
59 | ++u; | 59 | ++u; |
diff --git a/libbb/login.c b/libbb/login.c index 1cbadd228..308e1bfed 100644 --- a/libbb/login.c +++ b/libbb/login.c | |||
@@ -15,8 +15,8 @@ | |||
15 | 15 | ||
16 | #define LOGIN " login: " | 16 | #define LOGIN " login: " |
17 | 17 | ||
18 | static const char fmtstr_d[] = "%A, %d %B %Y"; | 18 | static const char fmtstr_d[] ALIGN1 = "%A, %d %B %Y"; |
19 | static const char fmtstr_t[] = "%H:%M:%S"; | 19 | static const char fmtstr_t[] ALIGN1 = "%H:%M:%S"; |
20 | 20 | ||
21 | void print_login_issue(const char *issue_file, const char *tty) | 21 | void print_login_issue(const char *issue_file, const char *tty) |
22 | { | 22 | { |
diff --git a/libbb/md5.c b/libbb/md5.c index e672559cf..9de37b9e4 100644 --- a/libbb/md5.c +++ b/libbb/md5.c | |||
@@ -75,7 +75,7 @@ static void md5_hash_block(const void *buffer, md5_ctx_t *ctx) | |||
75 | 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 | 75 | 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static const char P_array[] = { | 78 | static const char P_array[] ALIGN1 = { |
79 | # if MD5_SIZE_VS_SPEED > 1 | 79 | # if MD5_SIZE_VS_SPEED > 1 |
80 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */ | 80 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */ |
81 | # endif /* MD5_SIZE_VS_SPEED > 1 */ | 81 | # endif /* MD5_SIZE_VS_SPEED > 1 */ |
@@ -85,7 +85,7 @@ static void md5_hash_block(const void *buffer, md5_ctx_t *ctx) | |||
85 | }; | 85 | }; |
86 | 86 | ||
87 | # if MD5_SIZE_VS_SPEED > 1 | 87 | # if MD5_SIZE_VS_SPEED > 1 |
88 | static const char S_array[] = { | 88 | static const char S_array[] ALIGN1 = { |
89 | 7, 12, 17, 22, | 89 | 7, 12, 17, 22, |
90 | 5, 9, 14, 20, | 90 | 5, 9, 14, 20, |
91 | 4, 11, 16, 23, | 91 | 4, 11, 16, 23, |
diff --git a/libbb/messages.c b/libbb/messages.c index 8cab2dcc8..c4052b187 100644 --- a/libbb/messages.c +++ b/libbb/messages.c | |||
@@ -12,34 +12,34 @@ | |||
12 | #else | 12 | #else |
13 | #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" | 13 | #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" |
14 | #endif | 14 | #endif |
15 | const char bb_banner[] = BANNER; | 15 | const char bb_banner[] ALIGN1 = BANNER; |
16 | 16 | ||
17 | const char bb_msg_memory_exhausted[] = "memory exhausted"; | 17 | const char bb_msg_memory_exhausted[] ALIGN1 = "memory exhausted"; |
18 | const char bb_msg_invalid_date[] = "invalid date '%s'"; | 18 | const char bb_msg_invalid_date[] ALIGN1 = "invalid date '%s'"; |
19 | const char bb_msg_write_error[] = "write error"; | 19 | const char bb_msg_write_error[] ALIGN1 = "write error"; |
20 | const char bb_msg_read_error[] = "read error"; | 20 | const char bb_msg_read_error[] ALIGN1 = "read error"; |
21 | const char bb_msg_unknown[] = "(unknown)"; | 21 | const char bb_msg_unknown[] ALIGN1 = "(unknown)"; |
22 | const char bb_msg_can_not_create_raw_socket[] = "can't create raw socket"; | 22 | const char bb_msg_can_not_create_raw_socket[] ALIGN1 = "can't create raw socket"; |
23 | const char bb_msg_perm_denied_are_you_root[] = "permission denied. (are you root?)"; | 23 | const char bb_msg_perm_denied_are_you_root[] ALIGN1 = "permission denied. (are you root?)"; |
24 | const char bb_msg_requires_arg[] = "%s requires an argument"; | 24 | const char bb_msg_requires_arg[] ALIGN1 = "%s requires an argument"; |
25 | const char bb_msg_invalid_arg[] = "invalid argument '%s' to '%s'"; | 25 | const char bb_msg_invalid_arg[] ALIGN1 = "invalid argument '%s' to '%s'"; |
26 | const char bb_msg_standard_input[] = "standard input"; | 26 | const char bb_msg_standard_input[] ALIGN1 = "standard input"; |
27 | const char bb_msg_standard_output[] = "standard output"; | 27 | const char bb_msg_standard_output[] ALIGN1 = "standard output"; |
28 | 28 | ||
29 | const char bb_str_default[] = "default"; | 29 | const char bb_str_default[] ALIGN1 = "default"; |
30 | const char bb_hexdigits_upcase[] = "0123456789ABCDEF"; | 30 | const char bb_hexdigits_upcase[] ALIGN1 = "0123456789ABCDEF"; |
31 | 31 | ||
32 | const char bb_path_passwd_file[] = "/etc/passwd"; | 32 | const char bb_path_passwd_file[] ALIGN1 = "/etc/passwd"; |
33 | const char bb_path_shadow_file[] = "/etc/shadow"; | 33 | const char bb_path_shadow_file[] ALIGN1 = "/etc/shadow"; |
34 | const char bb_path_group_file[] = "/etc/group"; | 34 | const char bb_path_group_file[] ALIGN1 = "/etc/group"; |
35 | const char bb_path_gshadow_file[] = "/etc/gshadow"; | 35 | const char bb_path_gshadow_file[] ALIGN1 = "/etc/gshadow"; |
36 | const char bb_path_motd_file[] = "/etc/motd"; | 36 | const char bb_path_motd_file[] ALIGN1 = "/etc/motd"; |
37 | const char bb_dev_null[] = "/dev/null"; | 37 | const char bb_dev_null[] ALIGN1 = "/dev/null"; |
38 | const char bb_busybox_exec_path[] = CONFIG_BUSYBOX_EXEC_PATH; | 38 | const char bb_busybox_exec_path[] ALIGN1 = CONFIG_BUSYBOX_EXEC_PATH; |
39 | const char bb_default_login_shell[] = LIBBB_DEFAULT_LOGIN_SHELL; | 39 | const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL; |
40 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | 40 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, |
41 | * but I want to save a few bytes here. Check libbb.h before changing! */ | 41 | * but I want to save a few bytes here. Check libbb.h before changing! */ |
42 | const char bb_PATH_root_path[] = "PATH=/sbin:/usr/sbin:/bin:/usr/bin"; | 42 | const char bb_PATH_root_path[] ALIGN1 = "PATH=/sbin:/usr/sbin:/bin:/usr/bin"; |
43 | 43 | ||
44 | 44 | ||
45 | const int const_int_0; | 45 | const int const_int_0; |
@@ -47,7 +47,7 @@ const int const_int_1 = 1; | |||
47 | 47 | ||
48 | #include <utmp.h> | 48 | #include <utmp.h> |
49 | /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */ | 49 | /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */ |
50 | const char bb_path_wtmp_file[] = | 50 | const char bb_path_wtmp_file[] ALIGN1 = |
51 | #if defined _PATH_WTMP | 51 | #if defined _PATH_WTMP |
52 | _PATH_WTMP; | 52 | _PATH_WTMP; |
53 | #elif defined WTMP_FILE | 53 | #elif defined WTMP_FILE |
diff --git a/libbb/mode_string.c b/libbb/mode_string.c index d3ff18375..d17cc4a43 100644 --- a/libbb/mode_string.c +++ b/libbb/mode_string.c | |||
@@ -47,9 +47,9 @@ static const mode_t mode_flags[] = { | |||
47 | 47 | ||
48 | /* The previous version used "0pcCd?bB-?l?s???". However, the '0', 'C', | 48 | /* The previous version used "0pcCd?bB-?l?s???". However, the '0', 'C', |
49 | * and 'B' types don't appear to be available on linux. So I removed them. */ | 49 | * and 'B' types don't appear to be available on linux. So I removed them. */ |
50 | static const char type_chars[16] = "?pc?d?b?-?l?s???"; | 50 | static const char type_chars[16] ALIGN1 = "?pc?d?b?-?l?s???"; |
51 | /* 0123456789abcdef */ | 51 | /* 0123456789abcdef */ |
52 | static const char mode_chars[7] = "rwxSTst"; | 52 | static const char mode_chars[7] ALIGN1 = "rwxSTst"; |
53 | 53 | ||
54 | const char *bb_mode_string(mode_t mode) | 54 | const char *bb_mode_string(mode_t mode) |
55 | { | 55 | { |
diff --git a/libbb/mtab_file.c b/libbb/mtab_file.c index d00405d8a..030b148d3 100644 --- a/libbb/mtab_file.c +++ b/libbb/mtab_file.c | |||
@@ -11,5 +11,5 @@ | |||
11 | 11 | ||
12 | /* Busybox mount uses either /proc/mounts or /etc/mtab to | 12 | /* Busybox mount uses either /proc/mounts or /etc/mtab to |
13 | * get the list of currently mounted filesystems */ | 13 | * get the list of currently mounted filesystems */ |
14 | const char bb_path_mtab_file[] = | 14 | const char bb_path_mtab_file[] ALIGN1 = |
15 | USE_FEATURE_MTAB_SUPPORT("/etc/mtab")SKIP_FEATURE_MTAB_SUPPORT("/proc/mounts"); | 15 | USE_FEATURE_MTAB_SUPPORT("/etc/mtab")SKIP_FEATURE_MTAB_SUPPORT("/proc/mounts"); |
diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c index a31bd4bfd..fd5490039 100644 --- a/libbb/parse_mode.c +++ b/libbb/parse_mode.c | |||
@@ -31,8 +31,8 @@ int bb_parse_mode(const char *s, mode_t *current_mode) | |||
31 | S_ISUID | S_ISGID, /* s */ | 31 | S_ISUID | S_ISGID, /* s */ |
32 | S_ISVTX /* t */ | 32 | S_ISVTX /* t */ |
33 | }; | 33 | }; |
34 | static const char who_chars[] = "augo"; | 34 | static const char who_chars[] ALIGN1 = "augo"; |
35 | static const char perm_chars[] = "rwxXst"; | 35 | static const char perm_chars[] ALIGN1 = "rwxXst"; |
36 | 36 | ||
37 | const char *p; | 37 | const char *p; |
38 | mode_t wholist; | 38 | mode_t wholist; |
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c index 3178ad34a..1cadbd373 100644 --- a/libbb/process_escape_sequence.c +++ b/libbb/process_escape_sequence.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | char bb_process_escape_sequence(const char **ptr) | 19 | char bb_process_escape_sequence(const char **ptr) |
20 | { | 20 | { |
21 | static const char charmap[] = { | 21 | static const char charmap[] ALIGN1 = { |
22 | 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0, | 22 | 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0, |
23 | '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' }; | 23 | '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' }; |
24 | 24 | ||
diff --git a/libbb/uuencode.c b/libbb/uuencode.c index f525322f8..0aedf3387 100644 --- a/libbb/uuencode.c +++ b/libbb/uuencode.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include "libbb.h" | 8 | #include "libbb.h" |
9 | 9 | ||
10 | /* Conversion table. for base 64 */ | 10 | /* Conversion table. for base 64 */ |
11 | const char bb_uuenc_tbl_base64[65 + 2] = { | 11 | const char bb_uuenc_tbl_base64[65 + 2] ALIGN1 = { |
12 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', | 12 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', |
13 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', | 13 | 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', |
14 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', | 14 | 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', |
@@ -21,7 +21,7 @@ const char bb_uuenc_tbl_base64[65 + 2] = { | |||
21 | '\n', '\0' /* needed for uudecode.c */ | 21 | '\n', '\0' /* needed for uudecode.c */ |
22 | }; | 22 | }; |
23 | 23 | ||
24 | const char bb_uuenc_tbl_std[65] = { | 24 | const char bb_uuenc_tbl_std[65] ALIGN1 = { |
25 | '`', '!', '"', '#', '$', '%', '&', '\'', | 25 | '`', '!', '"', '#', '$', '%', '&', '\'', |
26 | '(', ')', '*', '+', ',', '-', '.', '/', | 26 | '(', ')', '*', '+', ',', '-', '.', '/', |
27 | '0', '1', '2', '3', '4', '5', '6', '7', | 27 | '0', '1', '2', '3', '4', '5', '6', '7', |