2008-10-24 01:58:21

by Tetsuo Handa

[permalink] [raw]
Subject: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) to immediately after declaration of nousb.

Hello.

I don't know the reason, but the below patch solves the problem which I'm
experiencing with CONFIG_USB=y on Debian Sarge (gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)).

Something is wrong with sorting symbol table or walking sysfs tree?

Without this patch:

# ls -ail /sys/module/usbcore/parameters/
total 0
200 drwxr-xr-x 2 root root 0 Oct 24 10:13
200 drwxr-xr-x 2 root root 0 Oct 24 10:13 .
199 drwxr-xr-x 4 root root 0 Oct 24 10:13 ..
201 -rw-r--r-- 1 root root 4096 Oct 24 10:13 autosuspend
203 -r--r--r-- 1 root root 4096 Oct 24 10:13 blinkenlights
204 -rw-r--r-- 1 root root 4096 Oct 24 10:13 old_scheme_first
205 -rw-r--r-- 1 root root 4096 Oct 24 10:13 use_both_schemes

With this patch:

# ls -ail /sys/module/usbcore/parameters/
total 0
200 drwxr-xr-x 2 root root 0 Oct 24 10:20 .
199 drwxr-xr-x 4 root root 0 Oct 24 10:20 ..
201 -rw-r--r-- 1 root root 4096 Oct 24 10:20 autosuspend
202 -r--r--r-- 1 root root 4096 Oct 24 10:20 blinkenlights
203 -rw-r--r-- 1 root root 4096 Oct 24 10:20 old_scheme_first
205 -rw-r--r-- 1 root root 4096 Oct 24 10:20 usbfs_snoop
204 -rw-r--r-- 1 root root 4096 Oct 24 10:20 use_both_schemes

Regards.

Signed-off-by: Tetsuo Handa <[email protected]>
---
drivers/usb/core/usb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.27.3.orig/drivers/usb/core/usb.c
+++ linux-2.6.27.3/drivers/usb/core/usb.c
@@ -47,6 +47,8 @@
const char *usbcore_name = "usbcore";

static int nousb; /* Disable USB when built into kernel image */
+/* format to disable USB on kernel command line is: nousb */
+__module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444);

/* Workqueue for autosuspend and for remote wakeup of root hubs */
struct workqueue_struct *ksuspend_usb_wq;
@@ -962,9 +964,6 @@ void usb_buffer_unmap_sg(const struct us
}
EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg);

-/* format to disable USB on kernel command line is: nousb */
-__module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444);
-
/*
* for external read access to <nousb>
*/


2008-10-24 04:21:59

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) to immediately after declaration of nousb.

On Fri, Oct 24, 2008 at 10:58:02AM +0900, Tetsuo Handa wrote:
> Hello.
>
> I don't know the reason, but the below patch solves the problem which I'm
> experiencing with CONFIG_USB=y on Debian Sarge (gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)).
>
> Something is wrong with sorting symbol table or walking sysfs tree?
>
> Without this patch:

This really sounds like a compiler bug somewhere, reordering this
shouldn't "fix" this issue. Is 3.3.5 still supported by the Debian
team? I know the minimum gcc version is 3.2 for the kernel, so it's
strange that no one else sees this.

I've tried gcc 4.1.2 and 4.3.2 and can't see this either, so something
wierd is going on.

Can you duplicate this in a stand-alone test module?

thanks,

greg k-h

2008-10-24 13:59:23

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) to immediately after declaration of nousb.

On Fri, 24 Oct 2008, Tetsuo Handa wrote:

> Hello.
>
> I don't know the reason, but the below patch solves the problem which I'm
> experiencing with CONFIG_USB=y on Debian Sarge (gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)).
>
> Something is wrong with sorting symbol table or walking sysfs tree?

It would be better if you could find the real cause of the problem. If
there's something wrong with the kernel code, then it can be fixed. If
it's a compiler bug then we can warn people about it.

Alan Stern

2008-10-24 15:26:30

by Tetsuo Handa

[permalink] [raw]
Subject: Re: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) toimmediately after declaration of nousb.

Hello.

I succeeded to produce this problem with 2.6.26 .
Thus, at least, it is not a new bug introduced in 2.6.27 .

Greg KH wrote:
> This really sounds like a compiler bug somewhere, reordering this
> shouldn't "fix" this issue.

I think so too.

> Is 3.3.5 still supported by the Debian team?

I think Security Support for Debian Sarge terminated on March 31st 2008.

> I know the minimum gcc version is 3.2 for the kernel, so it's
> strange that no one else sees this.

Thus, it is likely that nobody is using gcc (GCC) 3.3.5 (Debian 1:3.3.5-13).

> Can you duplicate this in a stand-alone test module?

Here is the patch for 2.6.26.7 and 2.6.27.3 .
But... please check this patch carefully. It seems that something is wrong.

----------------------------------------
---
drivers/usb/Makefile | 2 ++
drivers/usb/paramtest.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+)

--- linux-2.6.26.7.orig/drivers/usb/Makefile
+++ linux-2.6.26.7/drivers/usb/Makefile
@@ -2,6 +2,8 @@
# Makefile for the kernel USB device drivers.
#

+obj-y += paramtest.o
+
# Object files in subdirectories

obj-$(CONFIG_USB) += core/
--- /dev/null
+++ linux-2.6.26.7/drivers/usb/paramtest.c
@@ -0,0 +1,38 @@
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+
+static int param1;
+module_param(param1, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(param1, "param1");
+
+static int param2;
+module_param (param2, bool, S_IRUGO);
+MODULE_PARM_DESC (param2, "param2");
+
+static int param3;
+module_param(param3, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(param3, "param3");
+
+static int param4;
+module_param(param4, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(param4, "param4");
+
+static int param5;
+__module_param_call("", param5, param_set_bool, param_get_bool, &param5, 0444);
+
+static int param6;
+module_param_named(paramtest, param6, int, 0644);
+MODULE_PARM_DESC(paramtest, "param6");
+
+static int __init paramtest_init(void)
+{
+ return 0;
+}
+
+static void __exit paramtest_exit(void)
+{
+}
+
+subsys_initcall(paramtest_init);
+module_exit(paramtest_exit);
+MODULE_LICENSE("GPL");
----------------------------------------

Did I make a mistake in the above patch?
I tested after applying the above patch, and all results are wrong.

----------------------------------------
# cat /proc/version
Linux version 2.6.27.3 (root@tomoyo) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #2 SMP Fri Oct 24 23:45:52 JST 2008
# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 24 23:49 .
196 drwxr-xr-x 3 root root 0 Oct 24 23:49 ..
199 -r--r--r-- 1 root root 4096 Oct 24 23:49 amtest.param4
202 -r--r--r-- 1 root root 4096 Oct 24 23:49 param2
201 -rw-r--r-- 1 root root 4096 Oct 24 23:49 param3
200 -rw-r--r-- 1 root root 4096 Oct 24 23:49 param4
198 -rw-r--r-- 1 root root 4096 Oct 24 23:49 paramtest
----------
# cat /proc/version
Linux version 2.6.26.7 (root@tomoyo) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #2 SMP Fri Oct 24 23:47:07 JST 2008
# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 24 23:52 .
196 drwxr-xr-x 3 root root 0 Oct 24 23:52 ..
199 -r--r--r-- 1 root root 4096 Oct 24 23:52 amtest.param4
202 -r--r--r-- 1 root root 4096 Oct 24 23:52 param2
201 -rw-r--r-- 1 root root 4096 Oct 24 23:52 param3
200 -rw-r--r-- 1 root root 4096 Oct 24 23:52 param4
198 -rw-r--r-- 1 root root 4096 Oct 24 23:52 paramtest
----------
# cat /proc/version
Linux version 2.6.27.3 (root@tomoyo) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #2 SMP Fri Oct 24 22:12:09 JST 2008
tomoyo:~# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 24 22:14 .
196 drwxr-xr-x 3 root root 0 Oct 24 22:14 ..
202 -r--r--r-- 1 root root 4096 Oct 24 22:14 amtest.paramtest
198 -rw-r--r-- 1 root root 4096 Oct 24 22:14 param1
199 -r--r--r-- 1 root root 4096 Oct 24 22:14 param2
200 -rw-r--r-- 1 root root 4096 Oct 24 22:14 param3
201 -rw-r--r-- 1 root root 4096 Oct 24 22:14 param4
----------
# cat /proc/version
Linux version 2.6.26.7 (root@tomoyo) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #2 SMP Fri Oct 24 22:10:11 JST 2008
tomoyo:~# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 24 22:16 .
196 drwxr-xr-x 3 root root 0 Oct 24 22:16 ..
202 -r--r--r-- 1 root root 4096 Oct 24 22:16 amtest.paramtest
198 -rw-r--r-- 1 root root 4096 Oct 24 22:16 param1
199 -r--r--r-- 1 root root 4096 Oct 24 22:16 param2
200 -rw-r--r-- 1 root root 4096 Oct 24 22:16 param3
201 -rw-r--r-- 1 root root 4096 Oct 24 22:16 param4
----------------------------------------

However, applying the below patch after the above patch
prevents this problem from appearing.

----------------------------------------
---
drivers/usb/paramtest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.26.7.orig/drivers/usb/paramtest.c
+++ linux-2.6.26.7/drivers/usb/paramtest.c
@@ -18,12 +18,13 @@ module_param(param4, bool, S_IRUGO | S_I
MODULE_PARM_DESC(param4, "param4");

static int param5;
-__module_param_call("", param5, param_set_bool, param_get_bool, &param5, 0444);

static int param6;
module_param_named(paramtest, param6, int, 0644);
MODULE_PARM_DESC(paramtest, "param6");

+__module_param_call("", param5, param_set_bool, param_get_bool, &param5, 0444);
+
static int __init paramtest_init(void)
{
return 0;
----------------------------------------

----------------------------------------
# cat /proc/version
Linux version 2.6.27.3 (root@tomoyo) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #3 SMP Fri Oct 24 23:55:21 JST 2008
# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 25 00:00 .
196 drwxr-xr-x 3 root root 0 Oct 25 00:00 ..
202 -rw-r--r-- 1 root root 4096 Oct 25 00:00 param1
201 -r--r--r-- 1 root root 4096 Oct 25 00:00 param2
200 -rw-r--r-- 1 root root 4096 Oct 25 00:00 param3
199 -rw-r--r-- 1 root root 4096 Oct 25 00:00 param4
198 -rw-r--r-- 1 root root 4096 Oct 25 00:00 paramtest
----------
# cat /proc/version
Linux version 2.6.26.7 (root@tomoyo) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #3 SMP Fri Oct 24 23:56:17 JST 2008
# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 25 00:01 .
196 drwxr-xr-x 3 root root 0 Oct 25 00:01 ..
202 -rw-r--r-- 1 root root 4096 Oct 25 00:01 param1
201 -r--r--r-- 1 root root 4096 Oct 25 00:01 param2
200 -rw-r--r-- 1 root root 4096 Oct 25 00:01 param3
199 -rw-r--r-- 1 root root 4096 Oct 25 00:01 param4
198 -rw-r--r-- 1 root root 4096 Oct 25 00:01 paramtest
----------
# cat /proc/version
Linux version 2.6.27.3 (root@tomoyo) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #3 SMP Fri Oct 24 22:18:06 JST 2008
tomoyo:~# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 24 22:21 .
196 drwxr-xr-x 3 root root 0 Oct 24 22:21 ..
198 -rw-r--r-- 1 root root 4096 Oct 24 22:21 param1
199 -r--r--r-- 1 root root 4096 Oct 24 22:21 param2
200 -rw-r--r-- 1 root root 4096 Oct 24 22:21 param3
201 -rw-r--r-- 1 root root 4096 Oct 24 22:21 param4
202 -rw-r--r-- 1 root root 4096 Oct 24 22:21 paramtest
----------
# cat /proc/version
Linux version 2.6.26.7 (root@tomoyo) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #3 SMP Fri Oct 24 22:19:26 JST 2008
tomoyo:~# ls -ail /sys/module/paramtest/parameters/
total 0
197 drwxr-xr-x 2 root root 0 Oct 24 22:24 .
196 drwxr-xr-x 3 root root 0 Oct 24 22:24 ..
198 -rw-r--r-- 1 root root 4096 Oct 24 22:24 param1
199 -r--r--r-- 1 root root 4096 Oct 24 22:24 param2
200 -rw-r--r-- 1 root root 4096 Oct 24 22:24 param3
201 -rw-r--r-- 1 root root 4096 Oct 24 22:24 param4
202 -rw-r--r-- 1 root root 4096 Oct 24 22:24 paramtest
----------------------------------------

Well, I'm getting more and more confused.
It may be gcc3's bug, it may not be gcc's bug.

Regards.

2008-10-24 16:19:42

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) toimmediately after declaration of nousb.

On Sat, 25 Oct 2008, Tetsuo Handa wrote:

> Hello.
>
> I succeeded to produce this problem with 2.6.26 .
> Thus, at least, it is not a new bug introduced in 2.6.27 .
>
> Greg KH wrote:
> > This really sounds like a compiler bug somewhere, reordering this
> > shouldn't "fix" this issue.
>
> I think so too.

> Well, I'm getting more and more confused.
> It may be gcc3's bug, it may not be gcc's bug.

Why don't you simply look at the output from the compiler? Either the
.o file or else the intermediate .s file.

Alan Stern

2008-10-25 01:10:25

by Tetsuo Handa

[permalink] [raw]
Subject: Re: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) to immediately after declaration of nousb.

Hello.

I tried on Fedora 9 (gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)),
and I got the same result.

Just applying http://lkml.org/lkml/diff/2008/10/24/240/1 :
----------------------------------------
# cat /proc/version
Linux version 2.6.27.3 (root@tomoyo) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) ) #1 SMP Sat Oct 25 09:30:00 JST 2008
# ls -ail /sys/module/paramtest/parameters/
total 0
201 drwxr-xr-x 2 root root 0 2008-10-25 09:33 .
200 drwxr-xr-x 3 root root 0 2008-10-25 09:33 ..
206 -r--r--r-- 1 root root 4096 2008-10-25 09:33 param2
205 -rw-r--r-- 1 root root 4096 2008-10-25 09:33 param3
204 -rw-r--r-- 1 root root 4096 2008-10-25 09:33 param4
202 -rw-r--r-- 1 root root 4096 2008-10-25 09:33 paramtest
203 -r--r--r-- 1 root root 4096 2008-10-25 09:33 ramtest.param4
----------------------------------------

Also applying http://lkml.org/lkml/diff/2008/10/24/240/2 :
----------------------------------------
# cat /proc/version
Linux version 2.6.27.3 (root@tomoyo) (gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) ) #2 SMP Sat Oct 25 09:35:07 JST 2008
[root@tomoyo ~]# ls -ail /sys/module/paramtest/parameters/
total 0
201 drwxr-xr-x 2 root root 0 2008-10-25 09:42 .
200 drwxr-xr-x 3 root root 0 2008-10-25 09:42 ..
206 -rw-r--r-- 1 root root 4096 2008-10-25 09:42 param1
205 -r--r--r-- 1 root root 4096 2008-10-25 09:42 param2
204 -rw-r--r-- 1 root root 4096 2008-10-25 09:42 param3
203 -rw-r--r-- 1 root root 4096 2008-10-25 09:42 param4
202 -rw-r--r-- 1 root root 4096 2008-10-25 09:42 paramtest
----------------------------------------

Alan Stern wrote:
> Why don't you simply look at the output from the compiler? Either the
> .o file or else the intermediate .s file.

Here are output of 'objdump -x drivers/usb/paramtest.o'.
----------------------------------------
# cat diff1only

paramtest.o: file format elf32-i386
paramtest.o
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000000 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000018 00000000 00000000 00000034 2**2
ALLOC
3 .init.text 0000000c 00000000 00000000 00000034 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
4 .exit.text 0000000a 00000000 00000000 00000040 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
5 .exitcall.exit 00000004 00000000 00000000 0000004c 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
6 .initcall4.init 00000004 00000000 00000000 00000050 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
7 __param 00000078 00000000 00000000 00000054 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
8 .rodata 00000069 00000000 00000000 000000cc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .comment 0000002d 00000000 00000000 00000135 2**0
CONTENTS, READONLY
10 .note.GNU-stack 00000000 00000000 00000000 00000162 2**0
CONTENTS, READONLY
SYMBOL TABLE:
00000000 l df *ABS* 00000000 paramtest.c
00000000 l d .text 00000000 .text
00000000 l d .data 00000000 .data
00000000 l d .bss 00000000 .bss
00000000 l d .init.text 00000000 .init.text
00000000 l F .init.text 0000000c paramtest_init
00000000 l d .exit.text 00000000 .exit.text
00000000 l F .exit.text 0000000a paramtest_exit
00000000 l d .exitcall.exit 00000000 .exitcall.exit
00000000 l O .exitcall.exit 00000004 __exitcall_paramtest_exit
00000000 l d .initcall4.init 00000000 .initcall4.init
00000000 l O .initcall4.init 00000004 __initcall_paramtest_init4
00000000 l d __param 00000000 __param
00000000 l O __param 00000014 __param_paramtest
00000000 l O .rodata 00000014 __param_str_paramtest
00000000 l O .bss 00000004 param6
00000014 l O __param 00000014 __param_param5
00000014 l O .rodata 00000007 __param_str_param5
00000004 l O .bss 00000004 param5
00000028 l O __param 00000014 __param_param4
0000001c l O .rodata 00000011 __param_str_param4
00000008 l O .bss 00000004 param4
0000003c l O __param 00000014 __param_param3
00000030 l O .rodata 00000011 __param_str_param3
0000000c l O .bss 00000004 param3
00000050 l O __param 00000014 __param_param2
00000044 l O .rodata 00000011 __param_str_param2
00000010 l O .bss 00000004 param2
00000064 l O __param 00000014 __param_param1
00000058 l O .rodata 00000011 __param_str_param1
00000014 l O .bss 00000004 param1
00000000 l d .rodata 00000000 .rodata
00000000 l d .note.GNU-stack 00000000 .note.GNU-stack
00000000 l d .comment 00000000 .comment
00000000 *UND* 00000000 mcount
00000000 *UND* 00000000 param_set_int
00000000 *UND* 00000000 param_get_int
00000000 *UND* 00000000 param_set_bool
00000000 *UND* 00000000 param_get_bool


RELOCATION RECORDS FOR [.init.text]:
OFFSET TYPE VALUE
00000004 R_386_PC32 mcount


RELOCATION RECORDS FOR [.exit.text]:
OFFSET TYPE VALUE
00000004 R_386_PC32 mcount


RELOCATION RECORDS FOR [.exitcall.exit]:
OFFSET TYPE VALUE
00000000 R_386_32 .exit.text


RELOCATION RECORDS FOR [.initcall4.init]:
OFFSET TYPE VALUE
00000000 R_386_32 .init.text


RELOCATION RECORDS FOR [__param]:
OFFSET TYPE VALUE
00000000 R_386_32 .rodata
00000008 R_386_32 param_set_int
0000000c R_386_32 param_get_int
00000010 R_386_32 .bss
00000014 R_386_32 .rodata
0000001c R_386_32 param_set_bool
00000020 R_386_32 param_get_bool
00000024 R_386_32 .bss
00000028 R_386_32 .rodata
00000030 R_386_32 param_set_bool
00000034 R_386_32 param_get_bool
00000038 R_386_32 .bss
0000003c R_386_32 .rodata
00000044 R_386_32 param_set_bool
00000048 R_386_32 param_get_bool
0000004c R_386_32 .bss
00000050 R_386_32 .rodata
00000058 R_386_32 param_set_bool
0000005c R_386_32 param_get_bool
00000060 R_386_32 .bss
00000064 R_386_32 .rodata
0000006c R_386_32 param_set_bool
00000070 R_386_32 param_get_bool
00000074 R_386_32 .bss
----------------------------------------
# cat diff1and2

paramtest.o: file format elf32-i386
paramtest.o
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000000 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000018 00000000 00000000 00000034 2**2
ALLOC
3 .init.text 0000000c 00000000 00000000 00000034 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
4 .exit.text 0000000a 00000000 00000000 00000040 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
5 .exitcall.exit 00000004 00000000 00000000 0000004c 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
6 .initcall4.init 00000004 00000000 00000000 00000050 2**2
CONTENTS, ALLOC, LOAD, RELOC, DATA
7 __param 00000078 00000000 00000000 00000054 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
8 .rodata 00000069 00000000 00000000 000000cc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .comment 0000002d 00000000 00000000 00000135 2**0
CONTENTS, READONLY
10 .note.GNU-stack 00000000 00000000 00000000 00000162 2**0
CONTENTS, READONLY
SYMBOL TABLE:
00000000 l df *ABS* 00000000 paramtest.c
00000000 l d .text 00000000 .text
00000000 l d .data 00000000 .data
00000000 l d .bss 00000000 .bss
00000000 l d .init.text 00000000 .init.text
00000000 l F .init.text 0000000c paramtest_init
00000000 l d .exit.text 00000000 .exit.text
00000000 l F .exit.text 0000000a paramtest_exit
00000000 l d .exitcall.exit 00000000 .exitcall.exit
00000000 l O .exitcall.exit 00000004 __exitcall_paramtest_exit
00000000 l d .initcall4.init 00000000 .initcall4.init
00000000 l O .initcall4.init 00000004 __initcall_paramtest_init4
00000000 l d __param 00000000 __param
00000000 l O __param 00000014 __param_param5
00000000 l O .rodata 00000007 __param_str_param5
00000000 l O .bss 00000004 param5
00000014 l O __param 00000014 __param_paramtest
00000008 l O .rodata 00000014 __param_str_paramtest
00000004 l O .bss 00000004 param6
00000028 l O __param 00000014 __param_param4
0000001c l O .rodata 00000011 __param_str_param4
00000008 l O .bss 00000004 param4
0000003c l O __param 00000014 __param_param3
00000030 l O .rodata 00000011 __param_str_param3
0000000c l O .bss 00000004 param3
00000050 l O __param 00000014 __param_param2
00000044 l O .rodata 00000011 __param_str_param2
00000010 l O .bss 00000004 param2
00000064 l O __param 00000014 __param_param1
00000058 l O .rodata 00000011 __param_str_param1
00000014 l O .bss 00000004 param1
00000000 l d .rodata 00000000 .rodata
00000000 l d .note.GNU-stack 00000000 .note.GNU-stack
00000000 l d .comment 00000000 .comment
00000000 *UND* 00000000 mcount
00000000 *UND* 00000000 param_set_bool
00000000 *UND* 00000000 param_get_bool
00000000 *UND* 00000000 param_set_int
00000000 *UND* 00000000 param_get_int


RELOCATION RECORDS FOR [.init.text]:
OFFSET TYPE VALUE
00000004 R_386_PC32 mcount


RELOCATION RECORDS FOR [.exit.text]:
OFFSET TYPE VALUE
00000004 R_386_PC32 mcount


RELOCATION RECORDS FOR [.exitcall.exit]:
OFFSET TYPE VALUE
00000000 R_386_32 .exit.text


RELOCATION RECORDS FOR [.initcall4.init]:
OFFSET TYPE VALUE
00000000 R_386_32 .init.text


RELOCATION RECORDS FOR [__param]:
OFFSET TYPE VALUE
00000000 R_386_32 .rodata
00000008 R_386_32 param_set_bool
0000000c R_386_32 param_get_bool
00000010 R_386_32 .bss
00000014 R_386_32 .rodata
0000001c R_386_32 param_set_int
00000020 R_386_32 param_get_int
00000024 R_386_32 .bss
00000028 R_386_32 .rodata
00000030 R_386_32 param_set_bool
00000034 R_386_32 param_get_bool
00000038 R_386_32 .bss
0000003c R_386_32 .rodata
00000044 R_386_32 param_set_bool
00000048 R_386_32 param_get_bool
0000004c R_386_32 .bss
00000050 R_386_32 .rodata
00000058 R_386_32 param_set_bool
0000005c R_386_32 param_get_bool
00000060 R_386_32 .bss
00000064 R_386_32 .rodata
0000006c R_386_32 param_set_bool
00000070 R_386_32 param_get_bool
00000074 R_386_32 .bss
----------------------------------------
# diff diff1only diff1and2
46,51c46,51
< 00000000 l O __param 00000014 __param_paramtest
< 00000000 l O .rodata 00000014 __param_str_paramtest
< 00000000 l O .bss 00000004 param6
< 00000014 l O __param 00000014 __param_param5
< 00000014 l O .rodata 00000007 __param_str_param5
< 00000004 l O .bss 00000004 param5
---
> 00000000 l O __param 00000014 __param_param5
> 00000000 l O .rodata 00000007 __param_str_param5
> 00000000 l O .bss 00000004 param5
> 00000014 l O __param 00000014 __param_paramtest
> 00000008 l O .rodata 00000014 __param_str_paramtest
> 00000004 l O .bss 00000004 param6
68,69d67
< 00000000 *UND* 00000000 param_set_int
< 00000000 *UND* 00000000 param_get_int
71a70,71
> 00000000 *UND* 00000000 param_set_int
> 00000000 *UND* 00000000 param_get_int
97,98c97,98
< 00000008 R_386_32 param_set_int
< 0000000c R_386_32 param_get_int
---
> 00000008 R_386_32 param_set_bool
> 0000000c R_386_32 param_get_bool
101,102c101,102
< 0000001c R_386_32 param_set_bool
< 00000020 R_386_32 param_get_bool
---
> 0000001c R_386_32 param_set_int
> 00000020 R_386_32 param_get_int
----------------------------------------

I think the possible causes are either

(a) my patch is incorrect.
(b) symbol table handling is incorrect.

So, please check http://lkml.org/lkml/diff/2008/10/24/240/1 .

Regards.

2008-10-26 16:12:07

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH 2.6.27.3 usbcore] Move __module_param_call(nousb) to immediately after declaration of nousb.

On Sat, 25 Oct 2008, Tetsuo Handa wrote:

> Hello.
>
> I tried on Fedora 9 (gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)),
> and I got the same result.
>
> Just applying http://lkml.org/lkml/diff/2008/10/24/240/1 :

You've got a possible problem here:

> +static int param6;
> +module_param_named(paramtest, param6, int, 0644);
> +MODULE_PARM_DESC(paramtest, "param6");

You used paramtest as both the name of the module and the name of
the parameter. I don't know if that would cause the error you're
seeing, though. You might want to try again using a different name,
like param6test.

Alan Stern