From: "H. Peter Anvin" <hpa@zytor.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Huang, Ying" <ying.huang@intel.com>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>, Andi Kleen <ak@suse.de>,
Ian Campbell <ijc@hellion.org.uk>, Matt Mackall <mpm@selenic.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section
Date: Thu, 21 Feb 2008 10:34:39 -0800 [thread overview]
Message-ID: <47BDC43F.4070106@zytor.com> (raw)
In-Reply-To: <20080221095301.GA29361@elte.hu>
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
next prev parent reply other threads:[~2008-02-21 18:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 8:15 [PATCH 2/2] x86 : relocate uninitialized variable in init DATA section into init BSS section Huang, Ying
2008-02-21 9:05 ` Ingo Molnar
2008-02-21 9:28 ` Huang, Ying
2008-02-21 9:53 ` Ingo Molnar
2008-02-21 12:18 ` Matt Mackall
2008-02-21 18:34 ` H. Peter Anvin [this message]
2008-02-22 2:38 ` Huang, Ying
2008-02-22 2:42 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47BDC43F.4070106@zytor.com \
--to=hpa@zytor.com \
--cc=ak@suse.de \
--cc=ijc@hellion.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=mpm@selenic.com \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox