All of lore.kernel.org
 help / color / mirror / Atom feed
* module.c broken in latest snapshot
@ 2003-04-02 15:48 Brian Gerst
  2003-04-02 17:41 ` Kai Germaschewski
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Gerst @ 2003-04-02 15:48 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linux Kernel Mailing List

kernel/module.c: In function `check_modstruct_version':
kernel/module.c:845: warning: passing arg 2 of `__find_symbol' from 
incompatible pointer type
kernel/module.c:845: warning: passing arg 3 of `__find_symbol' from 
incompatible pointer type
kernel/module.c:847: warning: passing arg 5 of `check_version' from 
incompatible pointer type
kernel/module.c:847: too many arguments to function `check_version'
kernel/module.c: In function `load_module':
kernel/module.c:1276: structure has no member named `num_syms'

--
				Brian Gerst


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: module.c broken in latest snapshot
  2003-04-02 15:48 module.c broken in latest snapshot Brian Gerst
@ 2003-04-02 17:41 ` Kai Germaschewski
  2003-04-02 18:52   ` James Bottomley
  2003-04-02 23:43   ` Rusty Russell
  0 siblings, 2 replies; 4+ messages in thread
From: Kai Germaschewski @ 2003-04-02 17:41 UTC (permalink / raw)
  To: Brian Gerst; +Cc: Rusty Russell, James Bottomley, Linux Kernel Mailing List

On Wed, 2 Apr 2003, Brian Gerst wrote:

> kernel/module.c: In function `check_modstruct_version':
> kernel/module.c:845: warning: passing arg 2 of `__find_symbol' from 
> incompatible pointer type
> kernel/module.c:845: warning: passing arg 3 of `__find_symbol' from 
> incompatible pointer type
> kernel/module.c:847: warning: passing arg 5 of `check_version' from 
> incompatible pointer type
> kernel/module.c:847: too many arguments to function `check_version'
> kernel/module.c: In function `load_module':
> kernel/module.c:1276: structure has no member named `num_syms'

This patch should fix this problem and another, less obvious, one, which 
made symbols exported by modules not work.

--Kai

===== include/linux/module.h 1.57 vs edited =====
--- 1.57/include/linux/module.h	Mon Mar 24 19:34:42 2003
+++ edited/include/linux/module.h	Wed Apr  2 10:37:00 2003
@@ -183,7 +183,7 @@
 
 	/* Exported symbols */
 	const struct kernel_symbol *syms;
-	unsigned int num_ksyms;
+	unsigned int num_syms;
 	const unsigned long *crcs;
 
 	/* GPL-only exported symbols. */
@@ -233,7 +233,7 @@
 #ifdef CONFIG_KALLSYMS
 	/* We keep the symbol and string tables for kallsyms. */
 	Elf_Sym *symtab;
-	unsigned long num_syms;
+	unsigned long num_symtab;
 	char *strtab;
 #endif
 
===== kernel/module.c 1.72 vs edited =====
--- 1.72/kernel/module.c	Mon Mar 24 19:31:40 2003
+++ edited/kernel/module.c	Wed Apr  2 10:39:50 2003
@@ -156,7 +156,7 @@
 	/* Now try modules. */ 
 	list_for_each_entry(mod, &modules, list) {
 		*owner = mod;
-		for (i = 0; i < mod->num_ksyms; i++)
+		for (i = 0; i < mod->num_syms; i++)
 			if (strcmp(mod->syms[i].name, name) == 0) {
 				*crc = symversion(mod->crcs, i);
 				return mod->syms[i].value;
@@ -839,12 +839,13 @@
 					  unsigned int versindex,
 					  struct module *mod)
 {
-	unsigned int i;
-	struct kernel_symbol_group *ksg;
+	const unsigned long *crc;
+	struct module *owner;
 
-	if (!__find_symbol("struct_module", &ksg, &i, 1))
+	if (!__find_symbol("struct_module", &owner, &crc, 1))
 		BUG();
-	return check_version(sechdrs, versindex, "struct_module", mod, ksg, i);
+	return check_version(sechdrs, versindex, "struct_module", mod,
+			     crc);
 }
 
 /* First part is kernel version, which we ignore. */
@@ -1283,7 +1284,8 @@
 		mod->gpl_crcs = (void *)sechdrs[gplcrcindex].sh_addr;
 
 #ifdef CONFIG_MODVERSIONS
-	if ((mod->num_ksyms&&!crcindex) || (mod->num_gpl_syms&&!gplcrcindex)) {
+	if ((mod->num_syms && !crcindex) || 
+	    (mod->num_gpl_syms && !gplcrcindex)) {
 		printk(KERN_WARNING "%s: No versions for exported symbols."
 		       " Tainting kernel.\n", mod->name);
 		tainted |= TAINT_FORCED_MODULE;
@@ -1309,7 +1311,7 @@
 
 #ifdef CONFIG_KALLSYMS
 	mod->symtab = (void *)sechdrs[symindex].sh_addr;
-	mod->num_syms = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
+	mod->num_symtab = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
 	mod->strtab = (void *)sechdrs[strindex].sh_addr;
 #endif
 	err = module_finalize(hdr, sechdrs, mod);
@@ -1452,7 +1454,7 @@
 
 	/* Scan for closest preceeding symbol, and next symbol. (ELF
            starts real symbols at 1). */
-	for (i = 1; i < mod->num_syms; i++) {
+	for (i = 1; i < mod->num_symtab; i++) {
 		if (mod->symtab[i].st_shndx == SHN_UNDEF)
 			continue;
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: module.c broken in latest snapshot
  2003-04-02 17:41 ` Kai Germaschewski
@ 2003-04-02 18:52   ` James Bottomley
  2003-04-02 23:43   ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: James Bottomley @ 2003-04-02 18:52 UTC (permalink / raw)
  To: Kai Germaschewski; +Cc: Brian Gerst, Rusty Russell, Linux Kernel Mailing List

On Wed, 2003-04-02 at 11:41, Kai Germaschewski wrote:
> This patch should fix this problem and another, less obvious, one, which 
> made symbols exported by modules not work.

The patch certainly fixes my SCSI module hierarchy problems.

Thanks,

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: module.c broken in latest snapshot
  2003-04-02 17:41 ` Kai Germaschewski
  2003-04-02 18:52   ` James Bottomley
@ 2003-04-02 23:43   ` Rusty Russell
  1 sibling, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2003-04-02 23:43 UTC (permalink / raw)
  To: Kai Germaschewski; +Cc: torvalds, James Bottomley, Linux Kernel Mailing List

In message <Pine.LNX.4.44.0304021138570.8411-100000@chaos.physics.uiowa.edu> yo
u write:
> This patch should fix this problem and another, less obvious, one, which 
> made symbols exported by modules not work.

Sorry, I didn't test CONFIG_KALLSYMS=y.

This patch looks fine, Linus please apply.

Grr, fucking SMP box still doesn't stay up on 2.5, doing binary search
now ...

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

===== include/linux/module.h 1.57 vs edited =====
--- 1.57/include/linux/module.h	Mon Mar 24 19:34:42 2003
+++ edited/include/linux/module.h	Wed Apr  2 10:37:00 2003
@@ -183,7 +183,7 @@
 
 	/* Exported symbols */
 	const struct kernel_symbol *syms;
-	unsigned int num_ksyms;
+	unsigned int num_syms;
 	const unsigned long *crcs;
 
 	/* GPL-only exported symbols. */
@@ -233,7 +233,7 @@
 #ifdef CONFIG_KALLSYMS
 	/* We keep the symbol and string tables for kallsyms. */
 	Elf_Sym *symtab;
-	unsigned long num_syms;
+	unsigned long num_symtab;
 	char *strtab;
 #endif
 
===== kernel/module.c 1.72 vs edited =====
--- 1.72/kernel/module.c	Mon Mar 24 19:31:40 2003
+++ edited/kernel/module.c	Wed Apr  2 10:39:50 2003
@@ -156,7 +156,7 @@
 	/* Now try modules. */ 
 	list_for_each_entry(mod, &modules, list) {
 		*owner = mod;
-		for (i = 0; i < mod->num_ksyms; i++)
+		for (i = 0; i < mod->num_syms; i++)
 			if (strcmp(mod->syms[i].name, name) == 0) {
 				*crc = symversion(mod->crcs, i);
 				return mod->syms[i].value;
@@ -839,12 +839,13 @@
 					  unsigned int versindex,
 					  struct module *mod)
 {
-	unsigned int i;
-	struct kernel_symbol_group *ksg;
+	const unsigned long *crc;
+	struct module *owner;
 
-	if (!__find_symbol("struct_module", &ksg, &i, 1))
+	if (!__find_symbol("struct_module", &owner, &crc, 1))
 		BUG();
-	return check_version(sechdrs, versindex, "struct_module", mod, ksg, i);
+	return check_version(sechdrs, versindex, "struct_module", mod,
+			     crc);
 }
 
 /* First part is kernel version, which we ignore. */
@@ -1283,7 +1284,8 @@
 		mod->gpl_crcs = (void *)sechdrs[gplcrcindex].sh_addr;
 
 #ifdef CONFIG_MODVERSIONS
-	if ((mod->num_ksyms&&!crcindex) || (mod->num_gpl_syms&&!gplcrcindex)) {
+	if ((mod->num_syms && !crcindex) || 
+	    (mod->num_gpl_syms && !gplcrcindex)) {
 		printk(KERN_WARNING "%s: No versions for exported symbols."
 		       " Tainting kernel.\n", mod->name);
 		tainted |= TAINT_FORCED_MODULE;
@@ -1309,7 +1311,7 @@
 
 #ifdef CONFIG_KALLSYMS
 	mod->symtab = (void *)sechdrs[symindex].sh_addr;
-	mod->num_syms = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
+	mod->num_symtab = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
 	mod->strtab = (void *)sechdrs[strindex].sh_addr;
 #endif
 	err = module_finalize(hdr, sechdrs, mod);
@@ -1452,7 +1454,7 @@
 
 	/* Scan for closest preceeding symbol, and next symbol. (ELF
            starts real symbols at 1). */
-	for (i = 1; i < mod->num_syms; i++) {
+	for (i = 1; i < mod->num_symtab; i++) {
 		if (mod->symtab[i].st_shndx == SHN_UNDEF)
 			continue;
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-03  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-02 15:48 module.c broken in latest snapshot Brian Gerst
2003-04-02 17:41 ` Kai Germaschewski
2003-04-02 18:52   ` James Bottomley
2003-04-02 23:43   ` Rusty Russell

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.