Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the need of having both System.map file and /proc/kallsyms?

I just want to know the difference between System.map file and /proc/kallsyms.
I am using Linux 3.16 generic kernel. I know that both are the kernel symbol table.. When I did a compare on this files, both are having the same content.
So what is the need of having both?

like image 902
md.jamal Avatar asked Mar 09 '15 06:03

md.jamal


2 Answers

/proc/kallsyms have symbols of dynamically loaded modules as well static code and System.map is symbol tables of only static code.

You can not be really sure if System.map will be available on your system. When kernel and system.map mismatch you keep seeing System.map does not match actual kernel warning. So in that case/proc/kallsyms is the symbols of running kernel.

System.map isn't just useful for debugging kernel oopses. A few drivers need System.map to resolve symbols since they're linked against kernel headers instead of glibc). They won't work correctly without the System.map for the particular kernel currently running.

More info on http://dirac.org/linux/system.map/

like image 57
Milind Dumbare Avatar answered Oct 01 '22 22:10

Milind Dumbare


In short, if kaslr is not enabled,

system.map = $(nm vmlinux)
/proc/kallsysms = system.map + loaded modules's kallsyms
like image 32
firo Avatar answered Oct 02 '22 00:10

firo