Does it only contain names of the functions that the DLL exports or
also their offsets (Like an object file) ?
Let’s say we have an EXE file that uses a function from a DLL and we perform Load-time Dynamic Linking
As part of the PE format, the EXE contains an imports section
It receives the information due to a static link of the LIB files of the DLLS
import directory table:
The name of the DLL
Pointer to the entry in the ILT where the name of the function/symbol is stored
Pointer to the entry in the IAT where the name of the function/symbol is stored
Functions that the EXE did not use or the DLL do not go into IMPORTS
For example:
when we call a function, the linker plants the pointer to the IAT of that function as a reference
When the loader loads the program, it loads a list of DLLS and maps them into the process’s address space
Symbol resolution is performed to find the definitions of the functions and the DLL determined those functions to be visible
The names in the IAT table are replaced by the addresses of the functions
If the Loader loaded a DLL to a different address than the linker wanted, all the references are relocated
Do I understand correctly?
babushka69 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.