Given the following simple code snippet:
int main (void) {
void* foo = scanf;
void* bar = sscanf;
}
Here's the disassembly (Taken from the mach-o executable):
Small part of the non-lazy symbol pointers:
Small part of the symbol table:
I don't seem to understand the 5th and the 6th lines in the executable file (The movq of scanf & sscanf into rax/rcx). How do foo and bar (eventually) have the addresses of scanf & sscanf respectively. I think that it has something to do with the dynamic libraries which are mapped to the process (And the non-lazy symbol pointers most likely point there or something) but I can't understand how.
thanks