System.map Symbol Table parsing

Source: Internet
Author: User

Http://blog.chinaunix.net/uid-24148050-id-95497.html

System.map is a kernel symbol table file, produced by the "nm vmlinux" command, located in the source root directory.
The so-called "symbol" is the function name, global variable name, and so on, this table records these "symbols" in the kernel of the running address. (This is effective address, virtual address)

Here is a fragment of the file:
The so-called "symbol" is the function name, global variable name, and so on, this table records these "symbols" in the kernel of the running address. (This is effective address, virtual address)

Here is a fragment of the file:
C032ee18 T Genl_init
C032ef18 T Netfilter_init
C032EFCC T Netfilter_log_init
c032f020 T Netfilter_queue_init
c032f074 T Nfnetlink_init
C032F0FC T Nfnetlink_queue_init
C032f1e4 T Nfnetlink_log_init
C032f2d0 T Nf_conntrack_init
c032f48c T Nf_conntrack_standalone_init
c032f57c T Nf_conntrack_expect_init
c032f67c T Ctnetlink_init
From the above, Netfilter_init () is the address of 0xc032ef18
This is useful for debugging the kernel. For example, the kernel calls a function pointer, want to know which function it is pointing to, directly PRINTK the function pointer address, according to the address of the table is OK.


Symbol type

Name

Description

A

Absolute

The value of the symbol is absolute and will not be changed during further linking

B

Bss

The symbol is in the uninitialized data area or area (section), that is, in the BSS segment

C

Common

The symbols are public. The common symbol is uninitialized data. When linking, multiple common symbols may have the same name. If the symbol is defined elsewhere, the common symbol is considered to be an undefined reference

D

Data

The symbol is in the initialized data area

G

Global

A symbol is a symbol in a small object that has been initialized in the data area. Some destination file formats allow for more efficient access to small data objects, such as a global integer variable

I

Inderect

A symbol is an indirect reference to another symbol

N

Debugging

Symbol is a debug symbol

R

Read only

Symbol in a read-only data area

S

Small

Symbol is a symbol in the data area that is not initialized by a small object

T

Text

Symbols are symbols in the code area

U

Undefined

The symbol is external and has a value of 0 (undefined)

-

Stabs

A symbol is a stab symbol in the a.out destination file that is used to save debugging information

?

Unknown

The type of the symbol is unknown or related to the specific file format



PS. After the Linux kernel is started, you can view the symbol table by cat/proc/kallsyms.


To view a command for a symbol table

Nm-n Enetdbg.ko

LD Enetdbg.ko--print-map


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.