Support / Knowledge Base / Unresolved symbols and configuration mismatches

Unresolved symbols and configuration mismatches

1. Example of the error messages in question:

Using /lib/modules/2.4.2-2smp/misc/dgrp.o
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol securebits
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol schedule_timeout
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol __wake_up
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tty_unregister_driver
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol __generic_copy_from_user
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol schedule
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol vsprintf
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol kmalloc
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tty_register_driver
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol _ctype
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tq_timer
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol create_proc_entry
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol remove_wait_queue
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol do_gettimeofday
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol del_timer
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol interruptible_sleep_on
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol __pollwait
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol kfree
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol remove_proc_entry
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tty_hangup
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol add_wait_queue
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol in_egroup_p
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol simple_strtoul
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol proc_root
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol sprintf
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tty_hung_up_p
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tty_check_change
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol jiffies
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol tty_wait_until_sent
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol printk
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol add_timer
/lib/modules/2.4.2-2smp/misc/dgrp.o: unresolved symbol __generic_copy_to_user
ERROR: couldn't load driver (err: 1).

2. Explanation:

An unresolved symbol is simply our code attempting to access a symbol which is not currently accessible. In this case, we attempt to call a function in the Linux kernel which we cannot resolve (generally because of a slight difference in symbol names). So what can cause the actual symbol names for the functions in question to vary from what we expect? Variations between the kernel source and the running kernel. Our driver compiles against the kernel source, and so should work fine with a kernel compiled from that source (in that configuration).

Note:  This problem is generally the issue of your distribution company, rather than a Digi issue. The following steps may solve the problem, but we cannot guarantee it. If these steps do not resolve it, do contact your distribution company for assistance in ensuring that your kernel and kernel-source configuration match up.

3. Common configuration mismatches (and resolutions):
  • Compiling against something other than the kernel source for this kernel (Common Redhat 7.x issue).
This can be caused by failing to have the kernel source installed. Having the wrong version of the kernel source could cause this also, as could using Redhat 7.1. Redhat 7.1, even with the kernel source installed (isn't by default) places its source in the wrong place. To fix, do a ln -s /usr/src/linux-2.4.2 /usr/src/linux and reinstall the driver.
  • kernel (as in uname -a) is SMP and kernel source is configured for UP, or vice versa.
To determine whether this is the case, run cat /usr/src/linux/.config|grep SMP. Now check the running kernel with uname -a. If the source does not match the kernel, you'll need to make them match, either by rebooting onto another kernel or modifying your kernel source's configuration:

cd /usr/src/linux
make clean
vi .config

Change the line with CONFIG_SMP to read ''''# CONFIG_SMP is not set'''' if the uname did not show SMP. If it did, change that line to read '"CONFIG_SMP=y". Save and exit.

make dep
  • kernel version string differs from that in the kernel source
Compare the output of uname -a column 3 to the information cat /usr/src/linux/Makefile|head. Note that the kernel version string consists of

VERSION.PATCHLEVEL.SUBLEVEL-EXTRAVERSION

If VERSION, PATCHLEVEL, or SUBLEVEL are different, you''''ll need to obtain the kernel source that matches your kernel. However, if only EXTRAVERSION is different:

cd /usr/src/linux
make clean
vi Makefile

Now, change the EXTRAVERSION to be the same as the extraversion in the kernel version string from the uname command issued earlier. Save and exit.

make dep
  • kernel has modversions enabled, and kernel source does not, or vice versa.
Run "[ `cat /proc/ksyms|awk "{print $2}"|grep ^jiffies` != "jiffies" ]; echo $?" at the prompt. If that returns a 0, then your kernel does not have modversions enabled. Otherwise, it does.
 
Now we check your kernel source's configuration: cat /usr/src/linux/Makefile|grep MODVERSIONS. Change the Makefile to reflect the running kernel's configuration. ( "# MODVERSIONS is not set" to disable, and "MODVERSIONS=y" to enable).
Last updated: Aug 23, 2017
Contact a Digi expert and get started today! Contact Us