Finding the kernel address of a loadable kernel module

freax picture freax · Mar 21, 2013 · Viewed 9.2k times · Source

I'm trying to find the kernel address space where my loadable kernel module is relocated by insmod.

I came to know that by using the -m, -O switches while insmod'ing the module, we can only see the symbol table and the executable's sections' addresses from the view-point of the module and not their relocated addresses, as that process of relocation is carried out when we do an insmod.

Can anyone tell how to find the relocated address of a module in the kernel-memory i.e the address bound within the kernel where a loaded module resides?

Thanks!

P.S Please note that I'm using a Redhat 2.4 Linux kernel in which the /proc/modules listing doesn't show the virtual addresses of the loaded modules.

Answer

Ulka Vaze picture Ulka Vaze · Apr 6, 2013

Go to directory /sys/module/<module-name>/sections/.text - will show where the code is loaded /sys/module/<module-name>/sections/.data will show the data section and .bss for the bss section of the module.