Re: [PATCH] per-cpu areas for 2.5.3-pre6

From: Richard Henderson (rth@twiddle.net)
Date: Thu Jan 31 2002 - 00:49:35 EST


On Thu, Jan 31, 2002 at 09:45:45AM +1100, Rusty Russell wrote:
> "better". Believe me, I was fully aware, but I refuse to write such
> crap unless *proven* to be required.

You're going to wait until the compiler generates incorrect
code for you after knowing that it *probably* will? Nice.

> I agree that this is much better. But do not understand what small
> relocs have to do with simple address arithmetic? You've always been
> right before: what am I missing?

"Small" variables may be positioned by the compiler such that
they are addressable via a 16-bit relocation from some GP register.
If that variable isn't actually located in the small data area,
then the 16-bit relocation may overflow, resulting in link errors.

So it isn't a matter of the arithmetic itself, but loading the
addresses with which to do the arithmetic.

By declaring the variable to be an array of unspecified size,
you're giving the compiler no information as to the size of the
variable, and so it cannot assume the variable is located in the
small data area.

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



This archive was generated by hypermail 2b29 : Thu Jan 31 2002 - 21:01:32 EST