All of lore.kernel.org
 help / color / mirror / Atom feed
* div, udiv, mul, umul, rem, urem broken again?!?
@ 2005-10-05 22:10 Tom 'spot' Callaway
  2005-10-05 22:17 ` Tom 'spot' Callaway
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Tom 'spot' Callaway @ 2005-10-05 22:10 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]

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
-- 
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!

[-- Attachment #2: module-init-tools-3.2-sparc.patch --]
[-- Type: text/x-patch, Size: 1449 bytes --]

--- module-init-tools-3.2-pre9/depmod.c.BAD	2005-10-05 17:10:39.026053905 -0400
+++ module-init-tools-3.2-pre9/depmod.c	2005-10-05 18:09:11.354098881 -0400
@@ -103,10 +103,24 @@ void add_symbol(const char *name, struct
 
 static 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++;
--- module-init-tools-3.2-pre9/moduleops_core.c.BAD	2005-10-05 18:10:18.321918225 -0400
+++ module-init-tools-3.2-pre9/moduleops_core.c	2005-10-05 18:10:12.533798153 -0400
@@ -118,7 +118,7 @@ static void PERBIT(calculate_deps)(struc
 	for (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;
 

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

end of thread, other threads:[~2006-02-09  1:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-05 22:10 div, udiv, mul, umul, rem, urem broken again?!? Tom 'spot' Callaway
2005-10-05 22:17 ` Tom 'spot' Callaway
2005-10-06  0:24 ` David S. Miller
2005-10-06 13:21 ` Tom 'spot' Callaway
2005-10-10 10:20 ` Rusty Russell
2005-10-10 14:35 ` Tom 'spot' Callaway
2005-10-10 18:22 ` David S. Miller
2005-10-11 10:03 ` Rusty Russell
2005-11-06  0:40 ` David S. Miller
2005-11-06  4:13 ` Tom 'spot' Callaway
2005-11-06  6:27 ` Rusty Russell
2005-11-06 20:56 ` David S. Miller
2005-11-06 20:58 ` David S. Miller
2006-02-08 20:25 ` Martin Habets
2006-02-08 20:51 ` Tom 'spot' Callaway
2006-02-08 20:56 ` Al Viro
2006-02-09  1:29 ` 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.