Re: Memory Lay out - shared library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi


to make it clear .. say we have a program running in the RAM and it needs to load a library to access some function from the secondary storage and map it into its address space. how does the process get to know whether its present in the RAM already or the library is to be copied form the storage.

If the page is not in memory, page fault will happen and kernel will take care of
loading the page [demand paging] through the (*nopage) function of vm_area_struct,
if I'm not wrong.

Anand

regards
Srinivas
 


 
On 4/9/06, Hareesh Nagarajan <hnagar2@xxxxxxxxx > wrote:
On 4/8/06, Sumit Sahu <sumit.sahu.iitg@xxxxxxxxx > wrote:
Basically, ld.so calls mmap system call to memory map the shared
library file.  Now if one process had already mapped the library, when
another process wants to use the same library, the mmap syscall (which
is called by ld.so for the second process) takes care of determing
that the shared library file had already been mapped earlier and thus
to not load it again.

This is the way mmap works in the first place.
 
--
c u
 

./hareesh



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux