Messages in this thread | | | From | Keith Owens <> | Subject | Re: const __init | Date | Mon, 21 May 2001 13:07:50 +1000 |
| |
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.
- 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/
| |