[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47BDC43F.4070106@zytor.com>
Date: Thu, 21 Feb 2008 10:34:39 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Ingo Molnar <mingo@...e.hu>
CC: "Huang, Ying" <ying.huang@...el.com>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, Andi Kleen <ak@...e.de>,
Ian Campbell <ijc@...lion.org.uk>,
Matt Mackall <mpm@...enic.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA
section into init BSS section
Ingo Molnar wrote:
>
> well, that's bad. We'd silently ignore the " = 1" and boot up with that
> value at 0, right? At minimum we need some really prominent build-time
> _errors_ (i.e. aborted builds) if this ever happens. But ideally,
> shouldnt this whole thing be done at link time? Couldnt the linker sort
> the variables that are zero initialized into the right section, and move
> this constant maintenance pressure off the programmer's shoulder?
>
Not the linker (unless each variable is put in its own section)... the
compiler could (should!) do it... unfortunately gcc failed to provide a
way to specify rodata, data and bss sections for a single data item (on
the assumption that if you specified a section, you already knew were it
should be going.)
What we really need is a new gcc extension:
__attribute__((sections("data", "rodata", "bss")))
... where gcc stuffs it into the appropriate section depending on where
it belongs, just as it does with undecorated data items.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists