I can only answer your questions with respect to a normal UNIX application. I'm not sure they apply here where resources get resolved in terms of physical memory (and hence absolute offsets). I hope someone from the L4 group can tell you what the "right thing" is.
When a normal program is linked, is it linked with absolute addresses as well?
Yes. Every program (on a UNIX style system) has the entire address space to itself. At compile time functions get positions within an object file, when the program is linked, those offsets get resolved relative to everything else in the executable. Those all then get put in the text portion of the address space. Shared libraries get compiled as position independent code (relative offsets) so that the loader can choose where to put them in a program's address space.
And when it is loaded, it is relocated to the
right address?
Any physical address is the "right address", all programs start from virtual address 0.
Is
the virtual memory mechanism of making each program think it has all the memory to itself what allows this, rather than having to have programs linked in such a way that they could be loaded and run from whereever the program loader wants them to be?
Basically. Programs would obviously all have to be position independent in a single address space operating system e.g. Mungi or Opal or when running on hardware that doesn't have a proper MMU e.g. uC-Linux.
__________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards� http://movies.yahoo.com/