Once again, sorry for the bad title.
So I've been researching the PE format the last week, and I didn't quite get something. When a process loads, all the DLL's get mapped into memory. What I don't understand is, because a DLL can get loaded at a random base address, how is the code of the .exe file able to know the addresses of the API functions? Is there some "startup code" that looks for Kernel32.dll or something? I understand that is easy for the process to find functions with GetProcAddress, but how does it obtain the address of GetProcAddress?