Linux says a kernel module has an unknown symbol, but another loaded module provides it

24,368

I had similar issues compiling Advantech drivers. The operative phrase here is really "no symbol version".

Section 7 of http://lxr.linux.no/#linux+v2.6.33/Documentation/kbuild/modules.txt provides details on module versioning. Section 7.3 is of particular interest. The simplest solution for me was just to stick in a KBUILD_EXTRA_SYMBOLS line (as described starting at line 526 of modules.txt above). In your case, you could probably just add a line like

KBUILD_EXTRA_SYMBOLS := <driver_root>/kernel/core/Module.symvers

to the top of <driver_root>/kernel/USB-4761/Makefile.

Share:
24,368

Related videos on Youtube

raldi
Author by

raldi

Updated on September 17, 2022

Comments

  • raldi
    raldi over 1 year

    I'm trying to install a driver for a USB DAQ box, which annoyingly, I have to compile myself. I believe I've succeeded -- I have two .ko files:

    -rw-r--r--  1 root  root  45271 2010-03-18 21:24 advdrv_core.ko
    -rw-r--r--  1 root  root  24312 2010-03-18 21:24 usb4761.ko
    

    I was able to run insmod on the first without incident, but when I try on the second, I get a flood of messages:

    kernel: [686782.106547] usb4761: no symbol version for adv_process_info_check_event
    kernel: [686782.106555] usb4761: Unknown symbol adv_process_info_check_event
    kernel: [686782.106691] usb4761: no symbol version for advdrv_unregister_driver
    kernel: [686782.106695] usb4761: Unknown symbol advdrv_unregister_driver
    

    However, advdrv_core.ko provides these symbols. My kernel sure seems to have them in memory:

    # cat /proc/kallsyms | grep advdrv_unregister_driver
    f8d88504 r __ksymtab_advdrv_unregister_driver   [advdrv_core]
    f8d888d2 r __kstrtab_advdrv_unregister_driver   [advdrv_core]
    f8d885a4 r __kcrctab_advdrv_unregister_driver   [advdrv_core]
    086eb8fb a __crc_advdrv_unregister_driver       [advdrv_core]
    f8d86e90 t advdrv_unregister_driver     [advdrv_core]
    

    Why does my insmod claim they're unknown symbols?

    Edit: One of the answers below advised me to copy the files to /lib/modules and run depmod. So I did, using depmod's -v (verbose) option. Among the output were a bunch of lines like:

    /lib/modules/2.6.27-7-generic/kernel/drivers/pcmcia/usb4761.ko needs "advdrv_unregister_driver": /lib/modules/2.6.27-7-generic/kernel/drivers/pcmcia/advdrv_core.ko
    

    Then I ran rmmod advdrv_core to make sure I was installing it fresh, ran modprobe advdrv_core, and finally ran modprobe usb4761.

    Again, a bunch of failed symbols, including advdrv_unregister_driver.