Got table and PLT table knowledge detailed

Source: Internet
Author: User

GOT GOT table and PLT PLT table in the program of the role is very large, the next explanation I hope you can take a closer look

We use a very simple example to illustrate the following code:
Figure 1

Then we compile

We directly gdb./a.out gdb/a.out to perform the anti-compilation process, and then through Disasmain Disas Main, look at the anti-compilation code in main main function as follows:

Figure 3

We can observe the two functions of Gets@plt gets@plt and Puts@plt puts@plt, and why we add a @plt @plt, because this is the address of the data in the PLT PLT table. Then why does the code address in the anti-compilation be the address in the PLT plt table?

Reason

In order to better user experience and memory CPU CPU utilization, the program will be compiled with two tables to assist, one for the PLT PLT table, one for the GOT GOT table, the PLT PLT table can be called the internal function table, GOT GOT table for the Global function table (also can be said to be a dynamic function table This is a self-proclaimed), The two tables are relative, what is called relative, the PLT plt table data is an address in the GOT GOT table, it can be understood that must be one by one corresponding, as shown below:

Fig. 4 4

The data contents of each item in the PLT PLT table are corresponding to the address of an item in the GOT GOT table. This is fixed, and here we also know that the PLT PLT table data is not the actual address of the function, but the address of the GOT GOT table entry, good pit AH.

In fact, when you enter a function with a @plt @plt symbol, this function is actually a transitional function, because <

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.