From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: Re: const __init
Date: Mon, 21 May 2001 00:19:49 +0200 [thread overview]
Message-ID: <20010521001949.R754@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <Pine.LNX.4.05.10105202210370.1667-100000@callisto.of.borg> <3B083878.1785C27D@mandrakesoft.com>
In-Reply-To: <3B083878.1785C27D@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Sun, May 20, 2001 at 05:34:48PM -0400
On Sun, May 20, 2001 at 05:34:48PM -0400, Jeff Garzik wrote:
> This might be a very valid point...
>
> (let me know if the following test is flawed)
It is imho.
> > [jgarzik@rum tmp]$ cat > sectest.c
> > #include <linux/module.h>
> > #include <linux/init.h>
> > static const char version[] __initdata = "foo";
static char version2[] __initdata = "bar";
> > [jgarzik@rum tmp]$ gcc -D__KERNEL__ -I/spare/cvs/linux_2_4/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -mpreferred-stack-boundary=2 -march=i686 -c -o sectest.o sectest.c
> > [jgarzik@rum tmp]$
>
> No section type conflict appears.
Now it SHOULD conflict on these binutils, but doesn't on mine (2.9.5) ;-)
It is decided to put it into .data.init as expected.
AFAIK "const" is only a promise to the compiler, that we write
this data ONCE and read only after this initial write. So the
decision on the section is implementation defined.
What I don't understand is, why GCC overrides our explicit
override (done by setting the "section attribute" explicitly).
I would consider this a BUG in GCC. I don't understand, why we
support this BUG...
Maybe some GCC people can enlighten me, why GCC ignores such
overrides, that are for the cases where we DO KNOW BETTER than
GCC, what section is correct.
Regards
Ingo Oeser
--
To the systems programmer,
users and applications serve only to provide a test load.
next prev parent reply other threads:[~2001-05-20 22:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-20 19:51 Geert Uytterhoeven
2001-05-20 20:06 ` Jeff Garzik
2001-05-20 20:11 ` Geert Uytterhoeven
2001-05-20 21:34 ` Jeff Garzik
2001-05-20 22:19 ` Ingo Oeser [this message]
2001-05-21 2:43 ` Richard Henderson
2001-05-21 12:41 ` Jamie Lokier
2001-05-21 3:07 ` Keith Owens
2001-05-21 7:51 ` Richard Henderson
2001-05-21 20:01 ` J . A . Magallon
2001-05-20 20:16 ` Franz Sirl
2001-05-21 0:58 ` Keith Owens
2001-05-20 22:05 ` Russell King
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=20010521001949.R754@nightmaster.csn.tu-chemnitz.de \
--to=ingo.oeser@informatik.tu-chemnitz.de \
--cc=geert@linux-m68k.org \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®