I have a good book called Linkers and Loaders by John Levine, and I'm finding that while it's enlightening, I'm still left with questions. (Levine hasn't finished writing all the project code for the book's chapters; I'll get around to it, but first...)
Programs need to be relocated at run time if they aren't put at their declared link address, unless it is possible to do something with the virtual memory space so that the link time and load address is faked in the VM software (I haven't gotten that far yet in my study, I'm still working on mono-tasking without a VM manager!) I'm talking about comparitively simple statically linked programs. The relocation sections in the ELF binary tell the OS what needs to be relocated. Is it really "that simple?" Any gotchas here?
What about shared libraries and binaries linked with -FPIC or -DPIC? What's the difference between this and code that isn't using PIC, as far as the kernel's program loader/relocater code goes?
I'm wondering if it's worth starting with the simpler a.out format for binaries first, getting that working, then adding support for ELF binaries, and finally for the works, PIC and shared libraries and all.
Thanks...
