On Sun, 16 Sep 2001, Statux wrote:

> Comments follow (running kernel 2.4.9, custom.. module version info
> disabled since PPP support can't be compiled into the kernel with it
> on.. at least as of the original 2.4 kernels):
>
> > This is the printk symbol name in the kernel:
> > $ fgrep ' printk' /proc/ksyms
> > c0115fb0 printk_R1b7d4074
>
> that's not printk, though. That's printk_R1b7d4074 (mangled version?). My
> output of the command is:

I meant the mangled printk version of course.

>
> # fgrep ' printk' /proc/ksyms
> c0112b10 printk
>
> which matches my System.map file for the kernel:
>
> # cat /boot/System.map-2.4.9 | grep printk
> c0112b10 T printk

AFAIK, System.map has nothing to do with kernel modules.
System.map is used by 'ps' and 'syslog' to convert kernel addresses
into function names. Symbols in kernel modules are a different beast.
Only certain functions are exported by the kernel which are needed by
modules.

>
> So my first point is:
>
> 1) Are you (the original poster) using a RH built kernel or a custom one
I'm not using a custom kernel. It's an official RH kernel.

> 2) What kernel version are you using
I'm running the latest official RH kernel 2.4.3-12

> 3) If you are running a custom kernel, are you updating the System.map (in
> /boot or wherever) when you compile the kernel. A lot of people don't,
> which says that they don't know what the file is for.

See above. (but here is my link: /boot/System.map -> System.map-2.4.3-12)

>
> > Now I set the MODVERSIONS flag so that insmod also compares the versions
> > of the symbols in the modules against the version of the symbols in the
> > kernel:
> > gcc -c -DMODVERSIONS hello.c
> >
> > Now when I run insmod, it cannot resolve the printk symbol because printk
> > in the module has not been mangled (no checksum included):
>
> This works fine on my system. I was following along with the command line
> above in order to compile my module. I then insmod'd it and I didn't get
> any symbol dependency problems.
>
> > # insmod hello.o
> > hello.o: unresolved symbol printk
>
> As I said.. didn't get this. Worked fine.

Are you sure your kernel uses versioning?
I guess if the kernel doesn't use versioning, then it doesn't matter what
kind of mangled symbol your module uses.

>
> >
> > To mangle the names of each symbol in the module, add the following line
> > to your module:
> > #include <linux/modversions.h>
> >
> > Compile your module again (specify the directory for modversions.h):
> > gcc -c -DMODVERSIONS -I/usr/src/linux/include hello.c
>
> If you have your links set correctly, then you don't need to pass the
> include path here.
>

I did this to make it easy to follow. If you compile modules, you should
use a Makefile.


> lrwxrwxrwx    1 root     root           28 Jun  1 23:50 /usr/include/linux
> -> /usr/src/linux/include/linux
>
> lrwxrwxrwx    1 root     root           26 Jun  1 23:50 /usr/include/asm
> -> /usr/src/linux/include/asm
>
> This system doesn't seem to have a mangled printk at all and everything
> works well the way I have it set up. I was trying (with the above
> comments) to provide some suggestions and whatnot.

See above.

Werner

>
> Hope it helps :)
>
> -Statux
>
>
>
>
> _______________________________________________
> Seawolf-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/seawolf-list
>



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to