Why have a Stub in EXE, If the definition is here?
void foo() { return 2; } int main() { foo(); return 0; } OBJ: call _foo (direct symbol), opcode: (E8 = relative add) EXE: call j__foo (stub symbol) I think the assembler plants the stub because it is a reference in an object file and in the end it is not known where the function […]
Why do we need Stub in EXE If the definition is here?
I have a function whose definition is inside an object file
and I created an EXE file from it with the linker.
Is it because at the assembler stage it was not known where
the function would be in memory
and opcode E8 was created, so there must be a relative jump in the EXE
that will lead to jump to the address of the same function ?