diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-01 12:01:17 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-01 12:01:17 +0200 |
commit | 0004e994934374b5695e004bbcb7b1fd67a170f2 (patch) | |
tree | 6cbf7c0042fbd265b34f28111726b0f04c536818 /include | |
parent | 9dc04124d5a3f0c9be249287817a964691e187b0 (diff) | |
download | busybox-w32-0004e994934374b5695e004bbcb7b1fd67a170f2.tar.gz busybox-w32-0004e994934374b5695e004bbcb7b1fd67a170f2.tar.bz2 busybox-w32-0004e994934374b5695e004bbcb7b1fd67a170f2.zip |
better shared strings trick
text data bss dec hex filename
861980 441 7540 869961 d4649 busybox_old
861914 441 7540 869895 d4607 busybox_unstripped
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/include/libbb.h b/include/libbb.h index 6fb0438f5..4b69c855f 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1573,12 +1573,22 @@ void bb_progress_update(bb_progress_t *p, const char *curfile, | |||
1573 | off_t totalsize) FAST_FUNC; | 1573 | off_t totalsize) FAST_FUNC; |
1574 | 1574 | ||
1575 | extern const char *applet_name; | 1575 | extern const char *applet_name; |
1576 | |||
1577 | /* Some older linkers don't perform string merging, we used to have common strings | ||
1578 | * as global arrays to do it by hand. But: | ||
1579 | * (1) newer linkers do it themselves, | ||
1580 | * (2) however, they DONT merge string constants with global arrays, | ||
1581 | * even if the value is the same (!). Thus global arrays actually | ||
1582 | * increased size a bit: for example, "/etc/passwd" string from libc | ||
1583 | * wasn't merged with bb_path_passwd_file[] array! | ||
1584 | * Therefore now we use #defines. | ||
1585 | */ | ||
1576 | /* "BusyBox vN.N.N (timestamp or extra_version)" */ | 1586 | /* "BusyBox vN.N.N (timestamp or extra_version)" */ |
1577 | extern const char bb_banner[]; | 1587 | extern const char bb_banner[]; |
1578 | extern const char bb_msg_memory_exhausted[]; | 1588 | extern const char bb_msg_memory_exhausted[]; |
1579 | extern const char bb_msg_invalid_date[]; | 1589 | extern const char bb_msg_invalid_date[]; |
1580 | extern const char bb_msg_read_error[]; | 1590 | #define bb_msg_read_error "read error" |
1581 | extern const char bb_msg_write_error[]; | 1591 | #define bb_msg_write_error "write error" |
1582 | extern const char bb_msg_unknown[]; | 1592 | extern const char bb_msg_unknown[]; |
1583 | extern const char bb_msg_can_not_create_raw_socket[]; | 1593 | extern const char bb_msg_can_not_create_raw_socket[]; |
1584 | extern const char bb_msg_perm_denied_are_you_root[]; | 1594 | extern const char bb_msg_perm_denied_are_you_root[]; |
@@ -1588,18 +1598,23 @@ extern const char bb_msg_invalid_arg[]; | |||
1588 | extern const char bb_msg_standard_input[]; | 1598 | extern const char bb_msg_standard_input[]; |
1589 | extern const char bb_msg_standard_output[]; | 1599 | extern const char bb_msg_standard_output[]; |
1590 | 1600 | ||
1591 | extern const char bb_str_default[]; | ||
1592 | /* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ | 1601 | /* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ |
1593 | extern const char bb_hexdigits_upcase[]; | 1602 | extern const char bb_hexdigits_upcase[]; |
1594 | 1603 | ||
1595 | extern const char bb_path_mtab_file[]; | ||
1596 | extern const char bb_path_passwd_file[]; | ||
1597 | extern const char bb_path_shadow_file[]; | ||
1598 | extern const char bb_path_gshadow_file[]; | ||
1599 | extern const char bb_path_group_file[]; | ||
1600 | extern const char bb_path_motd_file[]; | ||
1601 | extern const char bb_path_wtmp_file[]; | 1604 | extern const char bb_path_wtmp_file[]; |
1602 | extern const char bb_dev_null[]; | 1605 | |
1606 | /* Busybox mount uses either /proc/mounts or /etc/mtab to | ||
1607 | * get the list of currently mounted filesystems */ | ||
1608 | #define bb_path_mtab_file IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts") | ||
1609 | |||
1610 | #define bb_path_passwd_file "/etc/passwd" | ||
1611 | #define bb_path_shadow_file "/etc/shadow" | ||
1612 | #define bb_path_gshadow_file "/etc/gshadow" | ||
1613 | #define bb_path_group_file "/etc/group" | ||
1614 | |||
1615 | #define bb_path_motd_file "/etc/motd" | ||
1616 | |||
1617 | #define bb_dev_null "/dev/null" | ||
1603 | extern const char bb_busybox_exec_path[]; | 1618 | extern const char bb_busybox_exec_path[]; |
1604 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | 1619 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, |
1605 | * but I want to save a few bytes here */ | 1620 | * but I want to save a few bytes here */ |