What is the nuclear symbol table (KERNEL SYMBOL TABLE)?

xiaoxiao2021-03-06  116

The kernel does not use the symbol name. It is an address (pointer) of a variable or function that uses a variable or function, rather than using SIZE_T BYTESREAD, the kernel prefer to use (for example) C0343F20 to reference this variable.

On the other hand, people don't like the names like C0343F20. We use the representation of the like size_t bytesRead. Usually, this will not bring any problems. The kernel is mainly written in C language, so the compiler / connection program allows us to use the symbol name when we program, and the kernel uses the address representation. So everyone is satisfied.

However, there is a case where we need to know the address of a symbol (or a symbol corresponding to the address). This is made through the symbolic table, and the GDB can give a function name from an address (or adding an address of a function name). The symbol table is a list of all symbols and their corresponding addresses. Here is a symbol table example:

c03441a0 B dmi_broken c03441a4 B is_sony_vaio_laptop c03441c0 b dmi_ident c0344200 b pci_bios_present c0344204 b pirq_table c0344208 b pirq_router c034420c b pirq_router_dev c0344220 b ascii_buffer c0344224 b ascii_buf_bytes you can see the name in the kernel address at c03441a0 as dmi_broken variable.

转载请注明原文地址:https://www.9cbs.com/read-100336.html

New Post(0)