[BusyBox] [PATCH] size optimization for fdformat.c

Tito farmatito at tiscali.it
Thu Jan 22 15:43:06 UTC 2004


On Thursday 22 January 2004 13:59, you wrote:
> Hello,
>
> On Thu, Jan 22, 2004 at 02:14:14PM +0000, Tito wrote:
> > on the other side all the error obj files sum up to  about 9k so by using
> > one function there would be size reduction to balance the overhead of one
> > more arg for every function and also the number of x and other bb
> > functions would decrease
> > saving more space.
> >
> > -rw-r--r--    1 root     root          968 Jan  6 14:19
> > error_msg_and_die.o -rw-r--r--    1 root     root          864 Jan  6
> > 14:19 error_msg.o -rw-r--r--    1 root     root          892 Jan  6 14:19
> > herror_msg_and_die.o -rw-r--r--    1 root     root          792 Jan  6
> > 14:19 herror_msg.o -rw-r--r--    1 root     root          892 Jan  6
> > 14:19 perror_msg_and_die.o -rw-r--r--    1 root     root          792 Jan
> >  6 14:19 perror_msg.o -rw-r--r--    1 root     root          808 Jan  6
> > 14:20 perror_nomsg_and_die.o -rw-r--r--    1 root     root          788
> > Jan  6 14:20 perror_nomsg.o -rw-r--r--    1 root     root         1080
> > Jan  6 14:20 verror_msg.o -rw-r--r--    1 root     root         1028 Jan 
> > 6 14:20 vherror_msg.o -rw-r--r--    1 root     root         1092 Jan  6
> > 14:20 vperror_msg.o tot. 9996
> >
> > and last but not least we would have a more flexible (and easy) api which
> > could lead to more size optimization.
>
> The size reported by 'ls' is meaningless in this contexts.  You need to
> use 'size' to see how much each object adds to the text, data, and bss
> sections.
Ops.
Thanks for the explanation.
size -t  *error*msg*.o
   text    data     bss     dec     hex filename
     38       0       0      38      26 error_msg_and_die.o
     31       0       0      31      1f error_msg.o
     25       0       0      25      19 herror_msg_and_die.o
     17       0       0      17      11 herror_msg.o
     25       0       0      25      19 perror_msg_and_die.o
     17       0       0      17      11 perror_msg.o
      7       0       0       7       7 perror_nomsg_and_die.o
      9       0       0       9       9 perror_nomsg.o
     61       0       0      61      3d verror_msg.o
     68       0       0      68      44 vherror_msg.o
     86       0       0      86      56 vperror_msg.o
    384       0       0     384     180 (TOTALS)

> To get a breakdown of sizes for functions and data within an object
> file, you can use something like 'nm -S --size-sort -t d <object file>'.
like this ?

busybox-1.00-pre5_new/libbb# nm -S --size-sort -t d  *error*msg*.o

error_msg_and_die.o:
0000000000000000 0000000000000038 T bb_error_msg_and_die

error_msg.o:
0000000000000000 0000000000000031 T bb_error_msg

herror_msg_and_die.o:
0000000000000000 0000000000000025 T bb_herror_msg_and_die

herror_msg.o:
0000000000000000 0000000000000017 T bb_herror_msg

perror_msg_and_die.o:
0000000000000000 0000000000000025 T bb_perror_msg_and_die

perror_msg.o:
0000000000000000 0000000000000017 T bb_perror_msg

perror_nomsg_and_die.o:
0000000000000000 0000000000000007 T bb_perror_nomsg_and_die

perror_nomsg.o:
0000000000000000 0000000000000009 T bb_perror_nomsg

verror_msg.o:
0000000000000000 0000000000000056 T bb_verror_msg

vherror_msg.o:
0000000000000000 0000000000000064 T bb_vherror_msg

vperror_msg.o:
0000000000000000 0000000000000076 T bb_vperror_msg
root at localhost:/dev/pts/3:/rep/busybox_old20031712/busybox-1.00-pre5_new/libbb#
> Manuel
Tito




More information about the busybox mailing list