InLinux, theSystem.map file is asymbol table used by thekernel.
A symbol table is a look-up between symbol names and their addresses in memory. A symbol name may be the name of a variable or the name of a function. The System.map is required when the address of a symbol name, or the symbol name of an address, is needed. It is especially useful for debuggingkernel panics andkernel oopses. The kernel does the address-to-name translation itself whenCONFIG_KALLSYMS
is enabled so that tools like ksymoops are not required.[1]
The following is part of aSystem.map
file:[2]
c041bc90 b packet_sklistc041bc94 b packet_sklist_lockc041bc94 b packet_socks_nrc041bc98 A __bss_stopc041bc98 A _endc041c000 A pg0ffffe400 A __kernel_vsyscallffffe410 A SYSENTER_RETURNffffe420 A __kernel_sigreturnffffe440 A __kernel_rt_sigreturn
Because addresses may change from one build to the next, a newSystem.map
is generated for each build of the kernel.[3]
The character between the address and the symbol (separated by spaces) is thetype of a symbol. Thenm
utility program onUnix systems lists the symbols from object files. TheSystem.map
is directly related to it, in that this file is produced bynm
on the whole kernel program – just likenm
lists the symbols and their types for any small object programs.[4]
Some of these types are:[4]
A
for absoluteB
orb
for uninitialized data section (called BSS)D
ord
for initialized data sectionG
org
for initialized data section for small objects (global)i
for sections specific to DLLsN
for debugging symbolp
for stack unwind sectionR
orr
for read only data sectionS
ors
for uninitialized data section for small objectsT
ort
for text (code) sectionU
for undefinedV
orv
for weak objectW
orw
for weak objects which have not been tagged so-
for stabs symbol in an a.out object file?
for "symbol type unknown"After building theLinux kernel,System.map
is located in the root of the source directory. However, some further software installation steps expect to locate the file elsewhere:[5]
/boot/System.map-$(uname -r)
/lib/modules/$(uname -r)/build/System.map