Re: [CRYPTO]: Miscompiling sha256.c by gcc 3.2.3 and arch pentium3,4

From: Bill Davidsen
Date: Mon Feb 02 2004 - 13:56:48 EST


On Sun, 1 Feb 2004, Linus Torvalds wrote:

>
>
> On Sun, 1 Feb 2004, Bill Davidsen wrote:
> >
> > What didn't you like about Jakob's patch which avoids the 64 byte size
> > penalty?
>
> What size penalty?
>
> The data has to be allocated somewhere, and on the stack is simply not
> acceptable. So there can be no size penalty.

The point was that it doesn't have to be allocated somewhere unless it's
actually used, and many kernels will want the capability but in practice
won't use it. David pointed out the overhead of repeated initialize, and
that's an overpowering reason not to do runtime allocation.

>
> Yes, the text size of the binary is slightly bigger, because a "static
> const" ends up in the ro-section, but that's _purely_ an accounting thing.
> It has to be somewhere, be it .text, .data or .bss. Who would ever care
> where it is?
>
> Having it in .ro means that there are no initialization issues, and a
> compressed kernel compresses the zero bytes better than having init-time
> code to initialize the array (or, worse, doing it over and over at
> run-time).
>
> So where does this size penalty idea come from?

--
bill davidsen <davidsen@xxxxxxx>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/