So, if I have MyDemo.h and MyDemo.cpp, when compiling MyDemo.cpp the compiler will produce the instructions of the function demoFunc in MyDemo.o, then when compiling main.cpp the compiler will see that the call to demoFunc in main is using the correct signature, and produce a function call to that function in the assembly instructions in main.o.
So now the linker has to connect the implementation of demoFunc in MyDemo.o with the function call im main.o and SOMEHOW make it inline, instead of a real function call by putting the parameters and the return address on the stack frame. How does the linker do this?