> * the whole loader sits in the kernel (maybe w/ some additional > helper deamon in userland), but userland can pass parameters > like search pathes, etc via env. > > IMHO having the dynamic loader in kernel-land (in contrary to ELF > on GNU) not just removes the need for lots of syscalls, but allows > a lot of optimizations, eg. code sharing w/ mmap() or caching > relocation data.
If you're interested in how to do dynamic loading in a clean and elegant way, take a look at Inferno. Along the lines of what you're suggesting, everything is a module. The only thing necessary to make a module suitable as a program to run from the command line is the existence of a function called init() with a particular signature. After studying and working with it, all of the other dynamic loading implementations out there are... well the word that comes to mind is 'disgusting.' BLS