Friends, I have two files, a.c and b.c . I have defined a function foo in a.c which is being called from b.c.
From what I understand, when the compiler tries to compile b.c, it will see that the implementation of foo is not in b, so it will add a entry for foo in the symbol table which os to be resolved at the linking time. I understood this concept properly.
Now, i have a different function printf in b.c which is implmented in glibc. From what i understand, printf can be linked at the loadtime or at the run time. If printf will be linked at the run time, there must have a stub for each call to printf which will be resolved at the run time using a system call.
my question is "Is my understanding correct ??? + how does the compiler determine that a function foo would be resolved by linker and not at run time ???"
i noticed some similar questions but could not understand their significance here ???