[PATCH] fix for kallsyms module symbol resolution problem

James Bottomley (James.Bottomley@steeleye.com)
27 Jun 2003 22:26:27 -0500


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-19254-1056771068-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

In lots of KALLSYMS symbol resolution in modules, I've noticed the
appearance of symbols with no names:

Jun 27 20:55:26 raven kernel: [<10131440>] schedule_timeout+0x78/0xdc
Jun 27 20:55:26 raven kernel: [<000f8240>] +0x4e0/0x598 [sunrpc]
Jun 27 20:55:26 raven kernel: [<0014504c>] +0x150/0x43c [nfsd]
Jun 27 20:55:26 raven kernel: [<10109c5c>] ret_from_kernel_thread+0x1c/0x24

The problem seems to be that get_ksymbol doesn't eliminate empty symbol
names when it does resolution. The attached patch should fix this.

James

--=_courier-19254-1056771068-0001-2
Content-Type: text/plain; name="tmp.diff"; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=tmp.diff

=3D=3D=3D=3D=3D kernel/module.c 1.87 vs edited =3D=3D=3D=3D=3D
--- 1.87/kernel/module.c Sat Jun 14 11:16:06 2003
+++ edited/kernel/module.c Fri Jun 27 22:10:58 2003
@@ -1760,7 +1760,8 @@
continue;
=20
if (mod->symtab[i].st_value <=3D addr
- && mod->symtab[i].st_value > mod->symtab[best].st_value)
+ && mod->symtab[i].st_value > mod->symtab[best].st_value
+ && *(mod->strtab + mod->symtab[i].st_name) !=3D '\0')
best =3D i;
if (mod->symtab[i].st_value > addr
&& mod->symtab[i].st_value < nextval)

--=_courier-19254-1056771068-0001-2--