div, udiv, mul, umul, rem, urem broken again?!?
Subsystems (3)
Built 2.6.14-rc3-git4 today for sparc32 and I got pages of this from depmod -aeF /boot/System.map-2.6.13-1.1594sp1 2.6.13-1.1594sp1:
WARNING: /lib/modules/2.6.13-1.1594sp1/kernel/sound/sparc/snd-sun-dbri.ko needs unknown symbol udiv
WARNING: /lib/modules/2.6.13-1.1594sp1/kernel/sound/sparc/snd-sun-dbri.ko needs unknown symbol div
WARNING: /lib/modules/2.6.13-1.1594sp1/kernel/sound/sparc/snd-sun-dbri.ko needs unknown symbol urem
WARNING: /lib/modules/2.6.13-1.1594sp1/kernel/sound/sparc/snd-sun-dbri.ko needs unknown symbol rem
WARNING: /lib/modules/2.6.13-1.1594sp1/kernel/sound/sparc/snd-sun-dbri.ko needs unknown symbol umul
Not just for dbri, but for pretty much everything built as a module. I tested the latest revision of module-utils to see if it made any difference, and it did not.
This looks like it tracks to:
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7caaeabb17758295edff9703c18a840073c5b8f4
Unfortunately, depmod had a workaround case for .* symbols, and it is now seems to be broken for these sparc symbols. I worked up the attached patch to resolve the issue, but I'm not sure if it is the most correct way to fix it.
~spot
Signature · 4 lines
Tom "spot" Callaway: Red Hat Senior Sales Engineer || GPG ID: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my!
depmod.c renamed from depmod.c.BAD +15 -1
@@ -103,10 +103,24 @@ void add_symbol(const char *name, structstatic int print_unknown; -struct module *find_symbol (const char *name,const char *modname,int weak) +struct module *find_symbol (char *name,const char *modname,int weak) {struct symbol *s; +/* Handle the wacky sparc cases */ +if (strcmp (name,".div" ) ==0 ) +strncpy (name,"_Div" ,sizeof (name)); +if (strcmp (name,".udiv" ) ==0 ) +strncpy (name,"_Udiv" ,sizeof (name)); +if (strcmp (name,".mul" ) ==0 ) +strncpy (name,"_Mul" ,sizeof (name)); +if (strcmp (name,".umul" ) ==0 ) +strncpy (name,"_Umul" ,sizeof (name)); +if (strcmp (name,".rem" ) ==0 ) +strncpy (name,"_Rem" ,sizeof (name)); +if (strcmp (name,".urem" ) ==0 ) +strncpy (name,"_Urem" ,sizeof (name)); +/* For our purposes, .foo matches foo. PPC64 needs this. */ if (name[0 ] =='.' ) name++;
moduleops_core.c renamed from moduleops_core.c.BAD +1 -1
@@ -118,7 +118,7 @@ static void PERBIT(calculate_deps)(strucfor (i =1 ; i < size /sizeof (syms[0 ]); i++) {if (END (syms[i].st_shndx, module->conv) ==SHN_UNDEF ) {/* Look for symbol */ -const char *name; +char *name;struct module *owner;int weak;
I accidentally sent a broken version of this patch, the attached version works.
~spot
Signature · 4 lines
Tom "spot" Callaway: Red Hat Senior Sales Engineer || GPG ID: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my!
depmod.c renamed from depmod.c.BAD +15 -1
@@ -103,10 +103,24 @@ void add_symbol(const char *name, structstatic int print_unknown; -struct module *find_symbol (const char *name,const char *modname,int weak) +struct module *find_symbol (char *name,const char *modname,int weak) {struct symbol *s; +/* Handle the wacky sparc cases */ +if (strcmp (name,".div" ) ==0 ) +strncpy (name,"_Div" ,sizeof (name)); +if (strcmp (name,".udiv" ) ==0 ) +strncpy (name,"_Udiv" ,sizeof (name)); +if (strcmp (name,".mul" ) ==0 ) +strncpy (name,"_Mul" ,sizeof (name)); +if (strcmp (name,".umul" ) ==0 ) +strncpy (name,"_Umul" ,sizeof (name)); +if (strcmp (name,".rem" ) ==0 ) +strncpy (name,"_Rem" ,sizeof (name)); +if (strcmp (name,".urem" ) ==0 ) +strncpy (name,"_Urem" ,sizeof (name)); +/* For our purposes, .foo matches foo. PPC64 needs this. */ if (name[0 ] =='.' ) name++;
moduleops_core.c renamed from moduleops_core.c.BAD +1 -1
@@ -118,7 +118,7 @@ static void PERBIT(calculate_deps)(strucfor (i =1 ; i < size /sizeof (syms[0 ]); i++) {if (END (syms[i].st_shndx, module->conv) ==SHN_UNDEF ) {/* Look for symbol */ -const char *name; +char *name;struct module *owner;int weak;
depmod.h renamed from depmod.h.BAD +1 -1
@@ -12,7 +12,7 @@ void *do_nofail(void *ptr, const char *f#define NOFAIL (ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr)void add_symbol (const char *name,struct module *owner); -struct module *find_symbol (const char *name,const char *modname,int weak); +struct module *find_symbol (char *name,const char *modname,int weak);void add_dep (struct module *mod,struct module *depends_on);/* I hate strcmp. */
David S. Miller
maintainerFrom: "Tom 'spot' Callaway" <[email protected]>
Date: Wed, 05 Oct 2005 17:10:54 -0500
Quoted 1 line
7caaeabb17758295edff9703c18a840073c5b8f4
This change should cause us to lookup ".[a-z]*" symbols as "_[A-Z]*", as per the change made in handle_modversions() in scripts/mod/modpost.c
So when a module references ".udiv" that symbol reference should get rewritten to "_Udiv" and that latter symbol is what we actually export from the kernel.
As best as I can tell, what is needed is similar logic in depmod. Ie. something like:
+ if (symname[0] = '.') {
+ char *munged = strdup(symname);
+ munged[0] = '_';
+ munged[1] = toupper(munged[1]);
+ symname = munged;
+ }
I see you just hardcoded the various ".*" symbol names Sparc uses in your patch.
Quoted 23 lines · David S. Miller
From: "Tom 'spot' Callaway" <[email protected]>
Date: Wed, 05 Oct 2005 17:10:54 -0500Quoted 1 line
7caaeabb17758295edff9703c18a840073c5b8f4This change should cause us to lookup ".[a-z]*" symbols as "_[A-Z]*", as per the change made in
handle_modversions()inscripts/mod/modpost.cSo when a module references ".udiv" that symbol reference should get rewritten to "
_Udiv" and that latter symbol is what we actually export from the kernel.As best as I can tell, what is needed is similar logic in depmod. Ie. something like:
(quoted diff) +6
-0+ if (symname[0] = '.') { + char *munged = strdup(symname); + munged[0] = '_'; + munged[1] = toupper(munged[1]); + symname = munged; + }
Quoted 2 lines
I see you just hardcoded the various ".*" symbol names Sparc uses in your patch.
My concern was the comment around the existing routine in the depmod code:
/* For our purposes, .foo matches foo. PPC64 needs this. */
if (name[0] = '.')
name++;If PPC64 still needs this, we can't just munge to the _<upper> condition universally, we still need some mechanism of identifying whether we want the PPC64 behavior for dot symbols or the sparc32 behavior for dot symbols. By hardcoding the six sparc specific symbols, and changing them first, we ensure that the PPC64 case still works.
I can shorten it a little bit by doing:
/* Handle the wacky sparc cases */
if (strcmp(name, ".div") = 0) || (strcmp(name, ".udiv") = 0)
|| (strcmp(name, ".mul") = 0)
(strcmp(name, ".umul") = 0) || (strcmp(name, ".rem") = 0)
|| (strcmp(name, ".urem") = 0) {
char *munged = strdup(name);
munged[0] = '_';
toupper(munged[1]);
name = munged;
}But we'd still have to hardcode the names.
Of course, all of this is moot if the PPC64 is munging their dot symbols in the same way.
~spot
Signature · 4 lines
Tom "spot" Callaway: Red Hat Senior Sales Engineer || GPG ID: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my!
Quoted 31 lines · Tom 'spot' Callaway
Quoted 23 lines · David S. Miller
From: "Tom 'spot' Callaway" <[email protected]>
Date: Wed, 05 Oct 2005 17:10:54 -0500Quoted 1 line
7caaeabb17758295edff9703c18a840073c5b8f4This change should cause us to lookup ".[a-z]*" symbols as "_[A-Z]*", as per the change made in
handle_modversions()inscripts/mod/modpost.cSo when a module references ".udiv" that symbol reference should get rewritten to "
_Udiv" and that latter symbol is what we actually export from the kernel.As best as I can tell, what is needed is similar logic in depmod. Ie. something like:
(quoted diff) +6
-0+ if (symname[0] = '.') { + char *munged = strdup(symname); + munged[0] = '_'; + munged[1] = toupper(munged[1]); + symname = munged; + }Quoted 2 lines
I see you just hardcoded the various ".*" symbol names Sparc uses in your patch.
My concern was the comment around the existing routine in the depmod code:
/* For our purposes, .foo matches foo. PPC64 needs this. */
Quoted 8 lines
if (name[0] = '.') name++;If PPC64 still needs this, we can't just munge to the _<upper> condition universally, we still need some mechanism of identifying whether we want the PPC64 behavior for dot symbols or the sparc32 behavior for dot symbols. By hardcoding the six sparc specific symbols, and changing them first, we ensure that the PPC64 case still works.
Anton CC'd. I think you can and should fix this within sparc32 arch-specific code by creating a macro which can export a symbol by a different name, eg: (untested)
#define __EXPORT_SPECIAL_SYMBOL(name, sym) \
static const char __kstrtab_##name[] \
__attribute__((section("__ksymtab_strings"))) \
= MODULE_SYMBOL_PREFIX #name; \
static const struct kernel_symbol __ksymtab_##name \
__attribute_used__ \
__attribute__((section("__ksymtab"), unused)) \
= { (unsigned long)&sym, __kstrtab_##name }Note, PPC64 still needs the dot hack because it changes the name of *every* function symbol.
Cheers,
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
Quoted 8 lines · Rusty Russell
#define __EXPORT_SPECIAL_SYMBOL(name, sym) \
static const char __kstrtab_##name[] \
__attribute__((section("__ksymtab_strings"))) \
= MODULE_SYMBOL_PREFIX #name; \
static const struct kernel_symbol __ksymtab_##name \
__attribute_used__ \
__attribute__((section("__ksymtab"), unused)) \
= { (unsigned long)&sym, __kstrtab_##name }Umm... isn't this how sparc used to do things? I think we're going in circles here...
~spot
Signature · 4 lines
Tom "spot" Callaway: Red Hat Senior Sales Engineer || GPG ID: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my!
David S. Miller
maintainerFrom: Rusty Russell <[email protected]>
Date: Mon, 10 Oct 2005 20:20:52 +1000
Quoted 11 lines
#define __EXPORT_SPECIAL_SYMBOL(name, sym) \ static const char __kstrtab_##name[] \ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #name; \ static const struct kernel_symbol __ksymtab_##name \ __attribute_used__ \ __attribute__((section("__ksymtab"), unused)) \ = { (unsigned long)&sym, __kstrtab_##name }Note, PPC64 still needs the dot hack because it changes the name of *every* function symbol.
The reason we did the ".foo" --> "_Foo" transformation was exactly because we didn't want to do crap like this any more.
It's error prone, and is nearly impossible to get working with every version of the compiler.
Why don't we just put an ifdef __sparc__ thing into modutils which understands the ".foo" --> "_Foo" translation?
Quoted 15 lines · David S. Miller
From: Rusty Russell <[email protected]>
Date: Mon, 10 Oct 2005 20:20:52 +1000Quoted 11 lines
#define __EXPORT_SPECIAL_SYMBOL(name, sym) \ static const char __kstrtab_##name[] \ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #name; \ static const struct kernel_symbol __ksymtab_##name \ __attribute_used__ \ __attribute__((section("__ksymtab"), unused)) \ = { (unsigned long)&sym, __kstrtab_##name }Note, PPC64 still needs the dot hack because it changes the name of *every* function symbol.
Quoted 8 lines
The reason we did the ".foo" --> "
_Foo" transformation was exactly because we didn't want to do crap like this any more.It's error prone, and is nearly impossible to get working with every version of the compiler.
Why don't we just put an ifdef
__sparc__thing into modutils which understands the ".foo" --> "_Foo" translation?
Um. We could do that. It's not clear to me why putting it in modutils will make it less "error prone" or portable. Exporting symbol with correct name need only be done in one place. Mangling needs to be done in three places (where it's exported, modprobe.c, and modutils).
The only reasons we can't export symbols like ".div" are (1) because the export macros use the symbol names to build temporary unique variable names. This is merely an implementation detail in the EXPORT_SYMBOL macro (we could use __LINE__ instead).
And (2) for PPC64, we put in the "ignore ." hack. Everyone used to be happy with that, so it wasn't made PPC64 specific. In retrospect, that was a mistake.
Look, I don't *actually* care. Send me whatever hack patch you want for sparc modutils. Then wait for me to do a new module-init-tools release to sync up. Repeat every time you change your mind.
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
David S. Miller
maintainerFrom: Rusty Russell <[email protected]>
Date: Tue, 11 Oct 2005 20:03:36 +1000
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
#define __EXPORT_SPECIAL_SYMBOL(name, sym) \ static const char __kstrtab_##name[] \ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #name; \ static const struct kernel_symbol __ksymtab_##name \ __attribute_used__ \ __attribute__((section("__ksymtab"), unused)) \ = { (unsigned long)&sym, __kstrtab_##name }Note, PPC64 still needs the dot hack because it changes the name of *every* function symbol.
How is this special export macro supposed to work?
I think I missed the idea whilst trying to implement your suggestion, as below, but it will not compile:
CC arch/sparc/kernel/sparc_ksyms.oarch/sparc/kernel/sparc_ksyms.c:306: error: parse error before '.' token arch/sparc/kernel/sparc_ksyms.c:307: error: initializer element is not constant
... etc. etc.
arch/sparc/kernel/module.c +1 -11
@@ -10,7 +10,6 @@#include <linux/vmalloc.h> #include <linux/fs.h> #include <linux/string.h> -#include <linux/ctype.h> void *module_alloc (unsigned long size) {
@@ -37,9 +36,7 @@ void module_free(struct module *mod, voitable entries. */ } -/* Make generic code ignore STT_REGISTER dummy undefined symbols, -* and replace references to .func with _Func -*/ +/* Make generic code ignore STT_REGISTER dummy undefined symbols. */ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings,
@@ -63,13 +60,6 @@ int module_frob_arch_sections(Elf_Ehdr *if (sym[i].st_shndx =SHN_UNDEF ) {if (ELF32_ST_TYPE (sym[i].st_info) =STT_REGISTER ) sym[i].st_shndx =SHN_ABS ; -else { -char *name = strtab + sym[i].st_name; -if (name[0 ] ='.' ) { - name[0 ] ='_' ; - name[1 ] =toupper (name[1 ]); - } - } } }return 0 ;
arch/sparc/kernel/sparc_ksyms.c +6 -16
@@ -94,16 +94,6 @@ extern void ___rw_read_enter(void);extern void ___rw_read_exit (void );extern void ___rw_write_enter (void ); -/* Alias functions whose names begin with "." and export the aliases. -* The module references will be fixed up by module_frob_arch_sections. -*/ -extern int _Div (int ,int ); -extern int _Mul (int ,int ); -extern int _Rem (int ,int ); -extern unsigned _Udiv (unsigned ,unsigned ); -extern unsigned _Umul (unsigned ,unsigned ); -extern unsigned _Urem (unsigned ,unsigned ); -/* used by various drivers */ EXPORT_SYMBOL (sparc_cpu_model);EXPORT_SYMBOL (kernel_thread);
@@ -313,12 +303,12 @@ EXPORT_SYMBOL(__lshrdi3);EXPORT_SYMBOL (__muldi3);EXPORT_SYMBOL (__divdi3); -EXPORT_SYMBOL (_Rem); -EXPORT_SYMBOL (_Urem); -EXPORT_SYMBOL (_Mul); -EXPORT_SYMBOL (_Umul); -EXPORT_SYMBOL (_Div); -EXPORT_SYMBOL (_Udiv); +__EXPORT_SPECIAL_SYMBOL(rem, .rem); +__EXPORT_SPECIAL_SYMBOL (urem, urem); +__EXPORT_SPECIAL_SYMBOL(mul, .mul); +__EXPORT_SPECIAL_SYMBOL(umul, .umul); +__EXPORT_SPECIAL_SYMBOL(div, .div); +__EXPORT_SPECIAL_SYMBOL(udiv, .udiv);#ifdef CONFIG_DEBUG_BUGVERBOSE EXPORT_SYMBOL (do_BUG);
arch/sparc/lib/mul.S +0 -2
@@ -16,9 +16,7 @@ */ .globl .mul - .globl _Mul .mul: -_Mul: /* needed for export */ mov %o0, %y ! multiplier -> Y andncc %o0, 0xfff, %g0 ! test bits 12..31 be Lmul_shortway ! if zero, can do it the short way
arch/sparc/lib/rem.S +0 -2
@@ -43,9 +43,7 @@ .globl .rem - .globl _Rem .rem: -_Rem: /* needed for export */ ! compute sign of result; if neither is negative, no problem orcc %o1, %o0, %g0 ! either negative? bge 2f ! no, go do the divide
arch/sparc/lib/sdiv.S +0 -2
@@ -43,9 +43,7 @@ .globl .div - .globl _Div .div: -_Div: /* needed for export */ ! compute sign of result; if neither is negative, no problem orcc %o1, %o0, %g0 ! either negative? bge 2f ! no, go do the divide
arch/sparc/lib/udiv.S +0 -2
@@ -43,9 +43,7 @@ .globl .udiv - .globl _Udiv .udiv: -_Udiv: /* needed for export */ ! Ready to divide. Compute size of quotient; scale comparand. orcc %o1, %g0, %o5
arch/sparc/lib/umul.S +0 -2
@@ -21,9 +21,7 @@ */ .globl .umul - .globl _Umul .umul: -_Umul: /* needed for export */ or %o0, %o1, %o4 mov %o0, %y ! multiplier -> Y
arch/sparc/lib/urem.S +0 -2
@@ -41,9 +41,7 @@ */ .globl .urem - .globl _Urem .urem: -_Urem: /* needed for export */ ! Ready to divide. Compute size of quotient; scale comparand. orcc %o1, %g0, %o5
include/linux/module.h +10 -0
@@ -198,6 +198,15 @@ void *__symbol_get_gpl(const char *symbo#define EXPORT_SYMBOL_GPL (sym) \ __EXPORT_SYMBOL(sym, "_gpl") +#define __EXPORT_SPECIAL_SYMBOL (name, sym) \ + static const char __kstrtab_##name[] \ + __attribute__((section("__ksymtab_strings"))) \ + = MODULE_SYMBOL_PREFIX #name; \ + static const struct kernel_symbol __ksymtab_##name \ + __attribute_used__ \ + __attribute__((section("__ksymtab"), unused)) \ + = { (unsigned long)&sym, __kstrtab_##name } +#endif struct module_ref
@@ -441,6 +450,7 @@ void module_remove_driver(struct device_#else /* !CONFIG_MODULES... */ #define EXPORT_SYMBOL (sym)#define EXPORT_SYMBOL_GPL (sym) +#define __EXPORT_SPECIAL_SYMBOL (name, sym)/* Given an address, look for it in the exception tables. */ static inline const struct exception_table_entry *
scripts/mod/modpost.c +0 -6
@@ -370,12 +370,6 @@ handle_modversions(struct module *mod, s/* Ignore register directives. */ if (ELF_ST_TYPE (sym->st_info) =STT_SPARC_REGISTER ) break; -if (symname[0 ] ='.' ) { -char *munged =strdup (symname); - munged[0 ] ='_' ; - munged[1 ] =toupper (munged[1 ]); - symname = munged; - } }#endif
Quoted 2 lines · David S. Miller
I think I missed the idea whilst trying to implement your suggestion, as below, but it will not compile:
Whoever "fixes" this issue, please test with module-init-tools as part of the confirmation process. It's never fun to discover that kernel modules just don't work.
~spot
Signature · 4 lines
Tom "spot" Callaway: Red Hat Senior Sales Engineer || GPG ID: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my!
Quoted 12 lines · David S. Miller
From: Rusty Russell <[email protected]>
Date: Tue, 11 Oct 2005 20:03:36 +1000Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
#define __EXPORT_SPECIAL_SYMBOL(name, sym) \ static const char __kstrtab_##name[] \ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #name; \ static const struct kernel_symbol __ksymtab_##name \ __attribute_used__ \ __attribute__((section("__ksymtab"), unused)) \ = { (unsigned long)&sym, __kstrtab_##name }
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Note, PPC64 still needs the dot hack because it changes the name of *every* function symbol.
How is this special export macro supposed to work?
Argh, it would need to use the alias trick, yes. As I said, untested. But, looking in 2.6.12, sparc already did this aliasing?
So my question is (I missed the beginning of this thread), why do you want to avoid the simple "omit the . at the front" name mangling scheme which modpost, kernel/module.c and module-init-tools already understand, and use a different mangling scheme? Name clash with something else? Why is "_Udiv" a better name than "udiv"?
And we shouldn't make it ifdef __sparc__ in module-init-tools anyway, since depmod is supposed to be platform neutral. Would have to be special case on ELF header or on names.
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman
David S. Miller
maintainerFrom: "Tom 'spot' Callaway" <[email protected]>
Date: Sat, 05 Nov 2005 22:13:39 -0600
Quoted 8 lines · David S. Miller
Quoted 3 lines
I think I missed the idea whilst trying to implement your suggestion, as below, but it will not compile:
Whoever "fixes" this issue, please test with module-init-tools as part of the confirmation process. It's never fun to discover that kernel modules just don't work.
If I do the work I'll send you a patch to test since I lack any 32-bit sparc system on which to test this.
David S. Miller
maintainerFrom: Rusty Russell <[email protected]>
Date: Sun, 06 Nov 2005 17:27:20 +1100
Quoted 2 lines
Argh, it would need to use the alias trick, yes. As I said, untested. But, looking in 2.6.12, sparc already did this aliasing?
And that aliasing trick is what we were trying to get rid of. It's nearly impossible to get it to work on all versions of the compiler at once.
I thought you had proposed a way to do it without aliases :-)
Quoted 5 lines
So my question is (I missed the beginning of this thread), why do you want to avoid the simple "omit the . at the front" name mangling scheme which modpost,
kernel/module.cand module-init-tools already understand, and use a different mangling scheme? Name clash with something else? Why is "_Udiv" a better name than "udiv"?
Good question, I'll think about this some more.
I tried to build 2.6.16-rc2 today, but got a lot of these errors from depmod:
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/crypto/crypto_null.ko needs unknown symbol urem
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/crypto/crypto_null.ko needs unknown symbol umul
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.ko needs unknown symbol udiv
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.ko needs unknown symbol div
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.ko needs unknown symbol urem
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.ko needs unknown symbol umul
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.ko needs unknown symbol udiv
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.ko needs unknown symbol div
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.ko needs unknown symbol urem
WARNING: /lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.ko needs unknown symbol umul
There was a long thread regarding this last october, but I did not find a resolution.
My module-init-tools are version 3.2-pre1-2 (Debian).
Any tips/hints?
Signature · 5 lines
Martin --------------------------------------------------------------------------- 30 years from now GNU/Linux will be as redundant a term as MERT/UNIX is today. - Martin Habets ---------------------------------------------------------------------------
Quoted 14 lines · Martin Habets
I tried to build 2.6.16-rc2 today, but got a lot of these errors from depmod:
WARNING:
/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crypto_null.koneeds unknown symbol urem
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crypto_null.koneeds unknown symbol umul
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol udiv
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol div
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol urem
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol umul
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol udiv
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol div
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol urem
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol umul
Quoted 6 lines
There was a long thread regarding this last october, but I did not find a resolution.
My module-init-tools are version 3.2-pre1-2 (Debian).
Any tips/hints?
There was no consensus about the best way to fix this issue... so it never got fixed.
The attached hack will get module-init-tools working on sparc (Aurora is using this in lieu of an actual fix).
~spot
Signature · 4 lines
Tom "spot" Callaway: Red Hat Senior Sales Engineer || GPG ID: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my!
depmod.c renamed from depmod.c.BAD +15 -1
@@ -103,10 +103,24 @@ void add_symbol(const char *name, structstatic int print_unknown; -struct module *find_symbol (const char *name,const char *modname,int weak) +struct module *find_symbol (char *name,const char *modname,int weak) {struct symbol *s; +/* Handle the wacky sparc cases */ +if (strcmp (name,".div" ) ==0 ) +strncpy (name,"_Div" ,sizeof (name)); +if (strcmp (name,".udiv" ) ==0 ) +strncpy (name,"_Udiv" ,sizeof (name)); +if (strcmp (name,".mul" ) ==0 ) +strncpy (name,"_Mul" ,sizeof (name)); +if (strcmp (name,".umul" ) ==0 ) +strncpy (name,"_Umul" ,sizeof (name)); +if (strcmp (name,".rem" ) ==0 ) +strncpy (name,"_Rem" ,sizeof (name)); +if (strcmp (name,".urem" ) ==0 ) +strncpy (name,"_Urem" ,sizeof (name)); +/* For our purposes, .foo matches foo. PPC64 needs this. */ if (name[0 ] =='.' ) name++;
moduleops_core.c renamed from moduleops_core.c.BAD +1 -1
@@ -118,7 +118,7 @@ static void PERBIT(calculate_deps)(strucfor (i =1 ; i < size /sizeof (syms[0 ]); i++) {if (END (syms[i].st_shndx, module->conv) ==SHN_UNDEF ) {/* Look for symbol */ -const char *name; +char *name;struct module *owner;int weak;
depmod.h renamed from depmod.h.BAD +1 -1
@@ -12,7 +12,7 @@ void *do_nofail(void *ptr, const char *f#define NOFAIL (ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr)void add_symbol (const char *name,struct module *owner); -struct module *find_symbol (const char *name,const char *modname,int weak); +struct module *find_symbol (char *name,const char *modname,int weak);void add_dep (struct module *mod,struct module *depends_on);/* I hate strcmp. */
FWIW, I'd do
if (!strcmp(str, ".mul") || ..........) {
str[0] = '_';
str[1] = toupper(str[1]);
}instead...
Quoted 15 lines · Tom 'spot' Callaway
Quoted 14 lines · Martin Habets
I tried to build 2.6.16-rc2 today, but got a lot of these errors from depmod:
WARNING:
/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crypto_null.koneeds unknown symbol urem
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crypto_null.koneeds unknown symbol umul
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol udiv
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol div
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol urem
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/crypto/crc32c.koneeds unknown symbol umul
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol udiv
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol div
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol urem
WARNING:/lib/modules/2.6.16-rc2-mph2/kernel/arch/sparc/kernel/led.koneeds unknown symbol umul
Quoted 2 lines
Quoted 2 lines
There was a long thread regarding this last october, but I did not find a resolution.
(1) it's just a warning, and it doesn't actually effect anything.
(2) Someone decided to be clever in arch/sparc/kernel/sparc_ksyms.c between 2.6.13 and 2.6.14. Rather than mangle ".div" to "div", they decided to mangle it to "_Div". The problem is that depmod knows about skipping the ".": it's done for other architectures. It has no idea about this new mangling.
2.6.12 did it the obvious way, 2.6.13 used asm, and 2.6.14 the new scheme. One wonders what was wrong with 2.6.12, but I haven't been following closely.
Now, possibly there was a legitimate reason not to pollute the namespace with these symbols, but they could probably have been made static without great concern.
Hope that clarifies,
Rusty.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol