Posts

Showing posts with the label Linux Device Driver Part 9

Linux Device Drivers Part 9 - More about Symbol tables

Image
In this part we will discuss about following topics About undefined symbol error and steps to solve it Is it mandatory to export the symbols ? Location of symbol table About system.map file in Linux 1. About undefined symbol error and steps to solve it The most common and most frustrating failure in loading an LKM is unresolved symbol, like this: insmod: error inserting 'helloworld.ko': -1 Unknown symbol in module To debug this error, 1. Use nm utility 2. Know symbol definitions (in next slide) Lets say my module is helloworld.ko In order to display symbol table, we use following command. $nm helloworld.ko. Output of this command is 00000000 r ____versions 0000002c r __mod_author22 00000000 r __mod_description24 00000020 r __mod_license23 00000040 r __mod_srcversion30 00000080 r __mod_vermagic5 00000063 r __module_depends 00000000 D __this_module 00000000 r _rheldata 00000000 T cleanup_module 00000000 B g_valu