Re: alpha modpost warnings

2007-06-06 Thread Sam Ravnborg
On Tue, Jun 05, 2007 at 07:35:02AM +0200, Sam Ravnborg wrote:
> > WARNING: drivers/built-in.o(.data.rel+0x1a80): Section mismatch: reference 
> > to .init.text:serial8250_console_setup (between 'serial8250_console' and 
> > '__param_arr_probe_rsa')

I wondered why this one showed up on alpha but nowhere else.
We already whitelist (do not warn about) references to .init.text from
variables named *_console IFF the variable is placed in section .data

But from the above we can see that serial8250_console is placed in .data.rel
Now I wonder why the alpha toolchain suddenly uses a .data.rel section.
The exact commandline to build the .c file is:

alpha-unknown-linux-gnu-gcc -Wp,-MD,drivers/serial/.8250.o.d  -nostdinc 
-isystem 
/opt/crosstool/gcc-4.1.0-glibc-2.3.6/alpha-unknown-linux-gnu/lib/gcc/alpha-unknown-linux-gnu/4.1.0/include
 -D__KERNEL__ -Iinclude -Iinclude2 -I/home/sam/kernel/kbuild.git/include 
-include include/linux/autoconf.h -I/home/sam/kernel/kbuild.git/drivers/serial 
-Idrivers/serial -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs 
-fno-strict-aliasing -fno-common -O2 -pipe -mno-fp-regs -ffixed-8 -msmall-data 
-mcpu=ev6 -Wa,-mev6 -fomit-frame-pointer -fno-stack-protector 
-Wdeclaration-after-statement -Wno-pointer-sign  -D"KBUILD_STR(s)=#s" 
-D"KBUILD_BASENAME=KBUILD_STR(8250)"  -D"KBUILD_MODNAME=KBUILD_STR(8250)" -c -o 
drivers/serial/8250.o /home/sam/kernel/kbuild.git/drivers/serial/8250.c

No use of -PIC or somethign like that.

Then I tried to reproduce it here - no luck.
I do not see the warning from serial/8250.o here?

I thought that I had all warnings reproduced but in the noise I must have
missed that I did not reproduce the 8250.o warning.

I will consider my patch for 8250.c bad and will drop it.
The others I will forward to akpm.

Anyone that can explain why alpha uses .data.rel in the above case -
but not with my toolchain?

$> gcc --version
alpha-unknown-linux-gnu-gcc (GCC) 4.1.0
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-06 Thread Meelis Roos
> A few of the above was easy to fix. See patch below.

This seems to work fine.

-- 
Meelis Roos ([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-06 Thread Meelis Roos
 A few of the above was easy to fix. See patch below.

This seems to work fine.

-- 
Meelis Roos ([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-06 Thread Sam Ravnborg
On Tue, Jun 05, 2007 at 07:35:02AM +0200, Sam Ravnborg wrote:
  WARNING: drivers/built-in.o(.data.rel+0x1a80): Section mismatch: reference 
  to .init.text:serial8250_console_setup (between 'serial8250_console' and 
  '__param_arr_probe_rsa')

I wondered why this one showed up on alpha but nowhere else.
We already whitelist (do not warn about) references to .init.text from
variables named *_console IFF the variable is placed in section .data

But from the above we can see that serial8250_console is placed in .data.rel
Now I wonder why the alpha toolchain suddenly uses a .data.rel section.
The exact commandline to build the .c file is:

alpha-unknown-linux-gnu-gcc -Wp,-MD,drivers/serial/.8250.o.d  -nostdinc 
-isystem 
/opt/crosstool/gcc-4.1.0-glibc-2.3.6/alpha-unknown-linux-gnu/lib/gcc/alpha-unknown-linux-gnu/4.1.0/include
 -D__KERNEL__ -Iinclude -Iinclude2 -I/home/sam/kernel/kbuild.git/include 
-include include/linux/autoconf.h -I/home/sam/kernel/kbuild.git/drivers/serial 
-Idrivers/serial -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs 
-fno-strict-aliasing -fno-common -O2 -pipe -mno-fp-regs -ffixed-8 -msmall-data 
-mcpu=ev6 -Wa,-mev6 -fomit-frame-pointer -fno-stack-protector 
-Wdeclaration-after-statement -Wno-pointer-sign  -DKBUILD_STR(s)=#s 
-DKBUILD_BASENAME=KBUILD_STR(8250)  -DKBUILD_MODNAME=KBUILD_STR(8250) -c -o 
drivers/serial/8250.o /home/sam/kernel/kbuild.git/drivers/serial/8250.c

No use of -PIC or somethign like that.

Then I tried to reproduce it here - no luck.
I do not see the warning from serial/8250.o here?

I thought that I had all warnings reproduced but in the noise I must have
missed that I did not reproduce the 8250.o warning.

I will consider my patch for 8250.c bad and will drop it.
The others I will forward to akpm.

Anyone that can explain why alpha uses .data.rel in the above case -
but not with my toolchain?

$ gcc --version
alpha-unknown-linux-gnu-gcc (GCC) 4.1.0
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Sam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-05 Thread Richard Henderson
On Tue, Jun 05, 2007 at 07:35:02AM +0200, Sam Ravnborg wrote:
> > WARNING: arch/alpha/kernel/built-in.o(.text+0x7d2c): Section mismatch:
> reference to .init.text:init_rtc_irq (between 'common_init_rtc' and
> 'timer_interrupt')

Yeah, I know about them of course.  The proper fix, as best I see it,
is to split the alpha_mv structure in two, one containing all the __init
pointers, and the other for more long term stuff.

I havn't tried to tackle this yet, as there are other more pressing 
issues, like how the glibc testsuite manages to generate soft lockups.


r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-05 Thread Richard Henderson
On Tue, Jun 05, 2007 at 07:35:02AM +0200, Sam Ravnborg wrote:
  WARNING: arch/alpha/kernel/built-in.o(.text+0x7d2c): Section mismatch:
 reference to .init.text:init_rtc_irq (between 'common_init_rtc' and
 'timer_interrupt')

Yeah, I know about them of course.  The proper fix, as best I see it,
is to split the alpha_mv structure in two, one containing all the __init
pointers, and the other for more long term stuff.

I havn't tried to tackle this yet, as there are other more pressing 
issues, like how the glibc testsuite manages to generate soft lockups.


r~
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-04 Thread Sam Ravnborg
On Mon, Jun 04, 2007 at 01:11:07PM +0300, Meelis Roos wrote:
> I am building current 2.6.22-rc3+git for my alpha (Eiger) and get these.
> 
>   MODPOST vmlinux
> WARNING: "saved_config" [arch/alpha/kernel/built-in] is COMMON symbol
> WARNING: arch/alpha/kernel/built-in.o(.text+0x7d2c): Section mismatch: 
> reference to .init.text:init_rtc_irq (between 'common_init_rtc' and 
> 'timer_interrupt')
> WARNING: arch/alpha/kernel/built-in.o(.text+0x7d30): Section mismatch: 
> reference to .init.text:init_rtc_irq (between 'common_init_rtc' and 
> 'timer_interrupt')
> WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x990): Section mismatch: 
> reference to .init.text:tsunami_init_arch (between 'eiger_mv' and 
> 'i8259a_irq_type')
> WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x998): Section mismatch: 
> reference to .init.text:eiger_init_irq (between 'eiger_mv' and 
> 'i8259a_irq_type')
> WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x9a8): Section mismatch: 
> reference to .init.text:common_init_pci (between 'eiger_mv' and 
> 'i8259a_irq_type')
> WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x9b8): Section mismatch: 
> reference to .init.text:eiger_swizzle (between 'eiger_mv' and 
> 'i8259a_irq_type')
> WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x9c0): Section mismatch: 
> reference to .init.text:eiger_map_irq (between 'eiger_mv' and 
> 'i8259a_irq_type')
> WARNING: arch/alpha/kernel/built-in.o(.data.rel.local+0x1060): Section 
> mismatch: reference to .init.text:srm_console_setup (between 'srmcons' and 
> 'tsunami_pci_ops')
> WARNING: drivers/built-in.o(.data.rel+0x1a80): Section mismatch: reference to 
> .init.text:serial8250_console_setup (between 'serial8250_console' and 
> '__param_arr_probe_rsa')


A few of the above was easy to fix. See patch below.
But alpha plays strange tricks with WEAK and ALIAS and __initdata for alpha_mv 
(and the cousins *_mv).
This is the reasons for most of the warnings - and I did not look deep enough 
to really understand
the logic (and thereby to come up with a fix).
Maybe the ALPHA maintainers can help?

Sam

Subject: fix section mismatch warings in alpha build

Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 930cedc..783f4e5 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -289,7 +289,7 @@ srm_console_device(struct console *co, int *index)
return srmcons_driver;
 }
 
-static int __init
+static int
 srm_console_setup(struct console *co, char *options)
 {
return 0;
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index e349f03..acc93ac 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -422,7 +422,7 @@ marvel_init_pci(void)
io7_clear_errors(io7);
 }
 
-static void
+static void __init
 marvel_init_rtc(void)
 {
init_rtc_irq();
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 4748e14..1dd50d0 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -144,7 +144,7 @@ irqreturn_t timer_interrupt(int irq, void *dev)
return IRQ_HANDLED;
 }
 
-void
+void __init
 common_init_rtc(void)
 {
unsigned char x;
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index c84dab0..6916cb2 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2515,7 +2515,10 @@ static int __init serial8250_console_setup(struct 
console *co, char *options)
 }
 
 static struct uart_driver serial8250_reg;
-static struct console serial8250_console = {
+
+/* Mark __init_refok so modpost do not warn about reference to
+ * function marked __init (serial8250_console_Setup() */
+static struct console __initdata_refok serial8250_console = {
.name   = "ttyS",
.write  = serial8250_console_write,
.device = uart_console_device,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-04 Thread Sam Ravnborg
> 
> Something for COMMON symbols was fixed for powerpc recently, the warning 
> is gone there.

For PowerPC the symbol was declared .common in the .S file.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-04 Thread Sam Ravnborg
 
 Something for COMMON symbols was fixed for powerpc recently, the warning 
 is gone there.

For PowerPC the symbol was declared .common in the .S file.

Sam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: alpha modpost warnings

2007-06-04 Thread Sam Ravnborg
On Mon, Jun 04, 2007 at 01:11:07PM +0300, Meelis Roos wrote:
 I am building current 2.6.22-rc3+git for my alpha (Eiger) and get these.
 
   MODPOST vmlinux
 WARNING: saved_config [arch/alpha/kernel/built-in] is COMMON symbol
 WARNING: arch/alpha/kernel/built-in.o(.text+0x7d2c): Section mismatch: 
 reference to .init.text:init_rtc_irq (between 'common_init_rtc' and 
 'timer_interrupt')
 WARNING: arch/alpha/kernel/built-in.o(.text+0x7d30): Section mismatch: 
 reference to .init.text:init_rtc_irq (between 'common_init_rtc' and 
 'timer_interrupt')
 WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x990): Section mismatch: 
 reference to .init.text:tsunami_init_arch (between 'eiger_mv' and 
 'i8259a_irq_type')
 WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x998): Section mismatch: 
 reference to .init.text:eiger_init_irq (between 'eiger_mv' and 
 'i8259a_irq_type')
 WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x9a8): Section mismatch: 
 reference to .init.text:common_init_pci (between 'eiger_mv' and 
 'i8259a_irq_type')
 WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x9b8): Section mismatch: 
 reference to .init.text:eiger_swizzle (between 'eiger_mv' and 
 'i8259a_irq_type')
 WARNING: arch/alpha/kernel/built-in.o(.data.rel+0x9c0): Section mismatch: 
 reference to .init.text:eiger_map_irq (between 'eiger_mv' and 
 'i8259a_irq_type')
 WARNING: arch/alpha/kernel/built-in.o(.data.rel.local+0x1060): Section 
 mismatch: reference to .init.text:srm_console_setup (between 'srmcons' and 
 'tsunami_pci_ops')
 WARNING: drivers/built-in.o(.data.rel+0x1a80): Section mismatch: reference to 
 .init.text:serial8250_console_setup (between 'serial8250_console' and 
 '__param_arr_probe_rsa')


A few of the above was easy to fix. See patch below.
But alpha plays strange tricks with WEAK and ALIAS and __initdata for alpha_mv 
(and the cousins *_mv).
This is the reasons for most of the warnings - and I did not look deep enough 
to really understand
the logic (and thereby to come up with a fix).
Maybe the ALPHA maintainers can help?

Sam

Subject: fix section mismatch warings in alpha build

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 930cedc..783f4e5 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -289,7 +289,7 @@ srm_console_device(struct console *co, int *index)
return srmcons_driver;
 }
 
-static int __init
+static int
 srm_console_setup(struct console *co, char *options)
 {
return 0;
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index e349f03..acc93ac 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -422,7 +422,7 @@ marvel_init_pci(void)
io7_clear_errors(io7);
 }
 
-static void
+static void __init
 marvel_init_rtc(void)
 {
init_rtc_irq();
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 4748e14..1dd50d0 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -144,7 +144,7 @@ irqreturn_t timer_interrupt(int irq, void *dev)
return IRQ_HANDLED;
 }
 
-void
+void __init
 common_init_rtc(void)
 {
unsigned char x;
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index c84dab0..6916cb2 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2515,7 +2515,10 @@ static int __init serial8250_console_setup(struct 
console *co, char *options)
 }
 
 static struct uart_driver serial8250_reg;
-static struct console serial8250_console = {
+
+/* Mark __init_refok so modpost do not warn about reference to
+ * function marked __init (serial8250_console_Setup() */
+static struct console __initdata_refok serial8250_console = {
.name   = ttyS,
.write  = serial8250_console_write,
.device = uart_console_device,
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/