declare more strings with ALIGN1

Aurelien Jarno aurelien at aurel32.net
Tue Jul 31 17:35:06 UTC 2012


On Wed, Jul 25, 2012 at 11:12:56PM +0400, Michael Tokarev wrote:
> On 24.07.2012 17:57, Denys Vlasenko wrote:
> > On Thu, Jul 19, 2012 at 11:56 AM, Michael Tokarev <mjt at tls.msk.ru> wrote:
> >> As with messages in libbb/messages.c and their declarations
> >> in include/libbb.h, there are a few other places where
> >> ALIGN1 (force no alignment) is used in definition but not
> >> in declaration, which leads to miscompiles.  Fix these
> >> too.
> > 
> > Applied, thanks!
> 
> There are a few other cases like this.  For example, ALIGN2
> is also used in definitions but not declarations.  I'm not
> sure it all is worth fixing - to my taste this whole construct
> is just too fragile, and having in mind gcc does not tell us
> the difference (it must, IMHO), it makes even more fragile.
> 
> In debian we fixed it by #defining ALIGN* to be empty on s390(x).
> 

Interestingly enough doing so make the resulting binary smaller on
s390x. Here is the bloatcheck result of the patch used in Debian (that
is comparing e565383f and e565383f + the patch):

function                                             old     new   delta
iproute_list_or_flush                               1410    1640    +230
do_iplink                                           1474    1626    +152
ipaddr_modify                                       1354    1498    +144
bb_dump_dump                                        1956    2098    +142
flush_block                                          782     894    +112
next_token                                          1140    1244    +104
udhcpc_main                                         2984    3086    +102
iproute_get                                          934    1020     +86
printf_main                                         1168    1212     +44
parse_command                                       2112    2156     +44
awk_main                                            1376    1416     +40
nfsmount                                            3900    3932     +32
write_block                                          518     544     +26
od_main                                             2422    2448     +26
print_found                                          474     498     +24
compress_block                                       520     542     +22
tftp_main                                           2264    2282     +18
parse_config_file                                    778     796     +18
sha_crypt                                           1598    1608     +10
run_applet_and_exit                                 1042    1048      +6
readtoken1                                          4606    4610      +4
eval6                                                748     752      +4
diff_main                                           1946    1950      +4
send_headers                                         876     878      +2
mv_main                                              646     648      +2
find_applet_by_name                                   80      82      +2
decode_one_format                                   1016    1018      +2
cmp_main                                             772     774      +2
mdev_main                                            986     984      -2
applet_name_compare                                   82      80      -2
sort_main                                           1196    1192      -4
last_main                                            554     550      -4
cgi_io_loop_and_exit                                 656     652      -4
bb_dump_add                                          584     580      -4
timescmd                                             176     170      -6
sighup_handler                                        22      16      -6
setConMode                                           128     122      -6
run                                                  348     342      -6
print_login_issue                                    452     446      -6
nvfree                                               296     290      -6
mkswap_main                                          406     400      -6
md5_process_block64                                  818     812      -6
ip_main                                              112     106      -6
get_lcm                                              162     156      -6
ftpgetput_main                                       528     522      -6
format_address_std                                    30      24      -6
chown_main                                           308     302      -6
bb_show_usage                                        272     266      -6
add_cmd                                             1574    1568      -6
expandarg                                           1406    1398      -8
bb_parse_mode                                        618     608     -10
sanitize_env_if_suid                                 116     104     -12
check_operator                                       138     126     -12
evaluate                                            4058    4044     -14
parse_conf                                          1550    1530     -20
arp_show                                             794     774     -20
static.options                                       161      61    -100
.rodata                                           102702  101330   -1372
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 28/30 up/down: 1404/-1678)     Total: -274 bytes
   text    data     bss     dec     hex filename
 762072    3783    9624  775479   bd537 busybox_old
 761832    3784    9624  775240   bd448 busybox_unstripped

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien at aurel32.net                 http://www.aurel32.net


More information about the busybox mailing list