my-server
← Wiki

System.map

In Linux, the file is a symbol table used by the kernel.

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 debugging kernel panics and kernel oopses. The kernel does the address-to-name translation itself when <code>CONFIG_KALLSYMS</code> is enabled so that tools like ksymoops are not required.

Internals

The following is part of a <code>System.map</code> file:

Because addresses may change from one build to the next, a new <code>System.map</code> is generated for each build of the kernel.

Symbol types

The character between the address and the symbol (separated by spaces) is the type of a symbol. The <code>nm</code> utility program on Unix systems lists the symbols from object files. The <code>System.map</code> is directly related to it, in that this file is produced by <code>nm</code> on the whole kernel program just like <code>nm</code> lists the symbols and their types for any small object programs.

Some of these types are:

  • <code>A</code> for absolute
  • <code>B</code> or <code>b</code> for uninitialized data section (called BSS)
  • <code>D</code> or <code>d</code> for initialized data section
  • <code>G</code> or <code>g</code> for initialized data section for small objects (global)
  • <code>i</code> for sections specific to DLLs
  • <code>N</code> for debugging symbol
  • <code>p</code> for stack unwind section
  • <code>R</code> or <code>r</code> for read only data section
  • <code>S</code> or <code>s</code> for uninitialized data section for small objects
  • <code>T</code> or <code>t</code> for text (code) section
  • <code>U</code> for undefined
  • <code>V</code> or <code>v</code> for weak object
  • <code>W</code> or <code>w</code> for weak objects which have not been tagged so
  • <code>-</code> for stabs symbol in an a.out object file
  • <code>?</code> for "symbol type unknown"

Filesystem location

After building the Linux kernel, <code>System.map</code> is located in the root of the source directory. However, some further software installation steps expect to locate the file elsewhere:

  • as <code>/boot/System.map-$(uname -r)</code>
  • building SVGAlib expects to find <code>/lib/modules/$(uname -r)/build/System.map</code>

See also

References