From: Keith Owens <kaos@ocs.com.au>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org.com>,
Linux Kernel Development <linux-kernel@vger.kernel.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: const __init
Date: Mon, 21 May 2001 13:07:50 +1000 [thread overview]
Message-ID: <13469.990414470@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Sun, 20 May 2001 17:34:48 -0400." <3B083878.1785C27D@mandrakesoft.com>
On Sun, 20 May 2001 17:34:48 -0400,
Jeff Garzik <jgarzik@mandrakesoft.com> wrote:
>(let me know if the following test is flawed)
>
> [jgarzik@rum tmp]$ cat > sectest.c
> #include <linux/module.h>
> #include <linux/init.h>
> static const char version[] __initdata = "foo";
> [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.
With just one variable in initdata there is no conflict, it takes two
to conflict.
static const char var1[] __attribute__ ((__section__ (".data.init"))) = "foo";
int main(void) { return(0); }
static int var2[] __attribute__ ((__section__ (".data.init"))) = {0,1};
does cause a section conflict, egcs 1.1.2.
Interestingly enough, if var[12] are together, without the intervening
text, then gcc does not flag an error, instead it puts both variables
in section .data.init and marks it as read only. This looks like a bug
in gcc.
next prev parent reply other threads:[~2001-05-21 7:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-20 19:51 const __init 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
2001-05-21 2:43 ` Richard Henderson
2001-05-21 12:41 ` Jamie Lokier
2001-05-21 3:07 ` Keith Owens [this message]
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=13469.990414470@kao2.melbourne.sgi.com \
--to=kaos@ocs.com.au \
--cc=geert@linux-m68k.org.com \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.