The relationship of the. Plt. Rel.dyn. Rel.plt. Got. Got.plt in the elf file

Source: Internet
Author: User

The role of the PLT is a springboard that preserves the offset of a symbol in the relocation table (used to find a symbol for the first time) and the corresponding address of the corresponding. Got.plt.

. Rel.dyn saved the start address of the. Got segment, not proven

. Rel.plt saved information for the relocation table

. Got is said to be the offset of each symbol that holds the elf file itself, i.e., do not dynamically link, does not prove

. GOT.PLT saved the relocation address.

For example, printf is a relocatable symbol, which is the process when the symbol needs to be connected:

The main function is one address in the call. PLT segment, The first sentence here is to switch to the address of the saved printf in the. GOT.PLT, if it is the first time, then the saved address is. In the next sentence of the PLT, the next sentence is to press the offset of the relocation table in the. REL.PLT, and then the LD program will add this offset based on the information in the relocation table Find this address and save it to the address pointed to by the relocation table, which is actually an address of the. GOT.PLT segment.

The second call can be taken directly to the address saved in the. got.plt.

In short, this design makes people feel very complete, have the connection, 6666666

The relationship of the. Plt. Rel.dyn. Rel.plt. Got. Got.plt in the elf file

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.