svn commit: trunk/busybox/coreutils

Denis Vlasenko vda.linux at googlemail.com
Thu Jan 18 15:04:02 UTC 2007


On Thursday 18 January 2007 09:14, Bernhard Fischer wrote:
> On Wed, Jan 17, 2007 at 04:53:35PM -0800, vda at busybox.net wrote:
> >Author: vda
> >Date: 2007-01-17 16:53:35 -0800 (Wed, 17 Jan 2007)
> >New Revision: 17359
> >
> >Log:
> >stop using global variable needlessly
> 
> define needlessly..

My definition is "use local variables for small, function-local data".

> On i386, i have:
> 
> $ size coreutils/stty.o*
>    text    data     bss     dec     hex filename
>    6184       8      14    6206    183e coreutils/stty.o.r17358
>    6213       8      14    6235    185b coreutils/stty.o.r17359
> 
> What figures do you see?

I see similar numbers. I looked into why. It happens because
we have more than 128 bytes of locals in stty_main and therefore
stack-relative addressing mode cannot use "short" (8-bit) displacement.
So 32-bit one is used instead. Also I see that gcc tries
to keep stty_state in register, thus some other things get spilled.

In other words: architecture and compiler-specific variation here.
--
vda



More information about the busybox mailing list