What exactly does mean?

前端 未结 1 885
忘掉有多难
忘掉有多难 2021-02-07 21:35

at the moment i try to get a bit closer to assembler programming and therefore looked at the assembler code of an easy hello world program:

#include 

        
相关标签:
1条回答
  • 2021-02-07 21:55

    PLT means Procedure Linkage Table. It is a special technique used in ELF files to localize fixing up at load time on machines where relative addressing is available.

    The function you're calling is located in another module (typically, libc.so.x), therefore the actual address of the function must be provided when the program is loaded for execution.

    PLT is essentially an area in your executable file (or .so file) where all outstanding references are collected together. They have the form of the target machine's jump instruction with the actual address remaining unfilled. It is up to loader to fill the addresses. The process is called fixing up.

    Because the remaining part of your module makes function calls through the PLT using relative addressing, and the offset to the PLT is known at the time of linking, nothing has to be fixed up there. This means that most of your module may continue to be mapped onto the module file instead of swap file.

    It has also to be noted that complementary to the PLT is the GOT, Global Offset Table. While PLT is used for function calls, GOT is used for data.

    0 讨论(0)
提交回复
热议问题