Originally Posted by
matsp
I couldn't be bothered to read all the text in the pages you linked to, but I know how it works from experience.
The linker WILL change the code generated by the compiler when the compiler is producing function calls outside of the current compile unit [a compile unit is normally one .c/.cpp file], where the linker finds the referred function in a different object file (the result of a different compile unit being compiled). If it can't find the function, it will generate an error.
The loader, when doing "fixup" will also modify these entries, when linking in the DLL's that the executable is using, e.g. C runtime library or Kernel32.dll.
In the case of DLL's being loaded into the system, these will potentially need to be relocated too - as the default DLL address isn't always available in the system, and thus the DLL will have to be located at a different (virtual) address, and all the addresses within the DLL that refer to absolute (virtual) addresses within that DLL will have to be "fixed up".
So, yes, the linker will definitely change what the compiler generated.
--
Mats