Ali Bahrami wrote: > Roland Mainz wrote: > > Is there any document which desocribes how |mmapobj()| is used to share > > shared library mappings between processes ? > > Just the manpage, and source, I think. > > mmapobj() is really just an ELF-aware variant of mmap(). It > doesn't bring anything new to the table in that regard.
Offtopic: "truss" knows about |mmap()| flags and translates them to ASCII text but |mmapobj()| flags are only shown as hexadecimal values... should I file a RFE for that ? > > Are the mappings always at > > the same place in the process address space ? > > You should not assume so. I don't want to assume any fixed address space location... my question is more which kind of optimisations are done and how the kernel is involved... for example does the kernel reserve a certain chunk of address space for such libraries (e.g. for 64bit applications reserve 0x0400000000000000-0x0500000000000000 to make sure it can map libc&co. across all 64bit processes into the same locations to reduce MMU overhead (e.g. that MMU entries can be shared between processes)) ? > The kernel is free to use its knowledge > that it is mapping ELF segments, and of the underlying hardware, to > pick optimal addresses, and these details are subject to change. Ok... > As I understand it, the whole point of mmapobj(), instead of ld.so.1 > calling mmap() as it used to, is to give the kernel that opportunity. > I expect the details to evolve over time. Ok... > > Does the kernel reserve > > any address space for such mappings ? Is there any predefined list of > > shared libraries which are "preloaded" (such as always mapping > > libc.so.1) ? > > I'm not aware of anything like that. I'm sure others will speak up > if there is. Ok... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;)