why does asking to build libbusybox change the size of busybox?

Denys Vlasenko vda.linux at googlemail.com
Fri Jul 18 19:06:02 UTC 2008


On Friday 18 July 2008 14:16, Robert P. J. Day wrote:
> 
>   perhaps a dumb question but, with a "defconfig" confguration, i
> built busybox and here are the results:
> 
> $ ls -l
> total 2104
> -rwxrwxr-x 1 rpjday rpjday 638976 2008-07-18 05:19 busybox
> -rwxrwxr-x 1 rpjday rpjday 760454 2008-07-18 05:19 busybox_unstripped
> -rw-rw-r-- 1 rpjday rpjday 712694 2008-07-18 05:19 busybox_unstripped.map
> -rw-rw-r-- 1 rpjday rpjday  27553 2008-07-18 05:19 busybox_unstripped.out
> $
> 
>   i then reconfigured and selected to build libbusybox, and that
> changed the busybox executables thusly:
> 
> $ ls -l
> total 2128
> -rwxrwxr-x 1 rpjday rpjday 700448 2008-07-18 05:22 busybox
> -rwxrwxr-x 1 rpjday rpjday 833086 2008-07-18 05:22 busybox_unstripped
> -rw-rw-r-- 1 rpjday rpjday 594534 2008-07-18 05:22 busybox_unstripped.map
> -rw-rw-r-- 1 rpjday rpjday  27579 2008-07-18 05:22 busybox_unstripped.out
> $
> 
>   the difference seems to be additional content in busybox_unstripped
> of the form:
> 
> 080748bf t .L10
> 0808b2ed t .L1011
> 0808b2fd t .L1015
> 0808b307 t .L1017
> 0808b31c t .L1018
> 0808b331 t .L1020
> 0808b341 t .L1021
> ...
> 
>   but why the additional content?  as i read it, simply selecting to
> build libbusybox shouldn't affect the busybox executable itself,
> should it?  after all, it's not as if the busybox executable is taking
> advantage of that new shared lib, so why the difference?  thanks.

This busybox executable is actually not very useful - the things
you want are in 0_lib/* in this case (including a very small
executable named "busybox").

This executable is linked exactly as normal "non-libbusybox" build would do it,
but individual .o modules were built with -fpic in order to libbusybox to work
and therefore they are bigger, and so this executable is bigger too.
--
vda



More information about the busybox mailing list