]> git.hungrycats.org Git - linux/commitdiff
[PATCH] 4kstacks: fix compile with gcc 2.95
authorDave Hansen <haveblue@us.ibm.com>
Tue, 10 Aug 2004 04:47:59 +0000 (21:47 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 10 Aug 2004 04:47:59 +0000 (21:47 -0700)
Investigation of why the build is failing due to bogus detection of
undefined symbols: We're getting this warning:

arch/i386/kernel/irq.c
{standard input}: Assembler messages:
{standard input}:3565: Warning: setting incorrect section type for
.bss.page_aligned

Which comes from this code in the 4k stacks code:

static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));

Removing the __section__() fixes it, as does moving to gcc 3.2 or 3.3,
but gcc 2.95 and 3.0 still exhibit the problem.  It seems the 4k stack
developers like newer compilers than I do :)

The gcc 2.95 section declaration looks like this:
.section        .bss.page_aligned,"aw",@progbits
while the 3.1 section looks like this:
.section        .bss.page_aligned,"aw",@nobits

It's definitely a bug that's been fixed:
http://sources.redhat.com/ml/binutils/2002-10/msg00507.html

I've been told that I can fix it with a carefully crafted assembly file and
maybe a change to the linker script, but all that it buys us is a little
space in the uncompressed kernel image.  Plus, the warning will still be
there at compile-time.

I say, put them back in plain old BSS.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/irq.c

index 7f52bc0d079ffbc8f17449096a69162766043d8c..355dc0ecaa89560220757102c31f9a4bd8f1cf93 100644 (file)
@@ -1116,8 +1116,12 @@ void init_irq_proc (void)
 
 
 #ifdef CONFIG_4KSTACKS
-static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
-static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
+/*
+ * These should really be __section__(".bss.page_aligned") as well, but
+ * gcc's 3.0 and earlier don't handle that correctly.
+ */
+static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE)));
+static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE)));
 
 /*
  * allocate per-cpu stacks for hardirq and for softirq processing