June 2017
Intermediate to advanced
478 pages
13h 14m
English
Debugging kernel modules presents an additional challenge because the code is relocated at runtime, and so you need to find out at what address it resides. The information is presented through sysfs. The relocation addresses for each section of the module are stored in /sys/module/<module name>/sections. Note that since ELF sections begin with a dot (.), they appear as hidden files, and you will have to use ls -a if you want to list them. The important ones are .text, .data, and .bss.
Take as an example a module named mbx:
# cat /sys/module/mbx/sections/.text0xbf000000# cat /sys/module/mbx/sections/.data0xbf0003e8# cat /sys/module/mbx/sections/.bss0xbf0005c0
Now you can use these numbers in GDB to load the symbol table ...
Read now
Unlock full access