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

/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/


In short, if kaslr is not enabled,

system.map = $(nm vmlinux)
/proc/kallsysms = system.map + loaded modules's kallsyms