Re: dso loading question

Albert D. Cahalan (acahalan@cs.uml.edu)
Sun, 30 May 1999 15:11:23 -0400 (EDT)


Ralf Baechle writes:
> On Wed, May 26, 1999 at 09:44:41PM -0700, Kanoj Sarcar wrote:

>> I am trying to understand how the glibc ld-linux code works just after
>> program startup. I have a small program
...
> mprotect calls may be necessary for mapping areas which are mapped without
> write access but where relocations need to be applied to.
...
> Read glibc/sysdeps/unix/sysv/linux/init-first.c. Actually the entire
> startuped & libc initialization code. It's quite complex.
>
> Btw, this all is done in userspace, therefore nothing for linux-kernel or
> linux-mm.

Putting all the above into the kernel would reduce overall bloat.
Think about it. Every damn executable has the same startup code.
We'd save a page (few pages?) of code and data on every executable,
as well as all the system calls:

All open() and close() calls are junk.
All mmap() calls may be replaced by direct VM manipulation.
All munmap() and mprotect() calls are junk.
The fstat() call is junk, since the kernel can just look.
The personality() call is junk. (directly read it)
The getpid() call is junk. (provide it in user-readable memory)

On every exec, that kills 16 system calls and a bit of IO.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/