Re: Virtual Memory Doubt

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

 



Hi Joel...

On Mon, Nov 2, 2009 at 10:34 PM, Joel Fernandes <agnel.joel@xxxxxxxxx> wrote:
> Hi Mulyadi, I will just add a few more questions, don't mind me poking
> in a bit.. :)

Sure :)

>> I think it's not the virtual address that is created, but the Virtual
>> Memory Area. Then, addresses are assigned to this VMA. Whether the VMA
>> contains page frame or not, that's another case.
>
> Do you mean VMA of another process exists at the same location?

Sorry, I don't understand on what you mean by "at the same location".
For sure, VMAs of a process live in distinct address space, so it
can't interfere with other process. However, threads within same
process do share address space, thus their VMAs share same land

>Also
> as I understand it - each process has its own virtual memory sandbox,
> and that the addresses of kernel and userspace can't overlap, but of 2
> different userspace processes can, is this correct?

Yup, for user mode virtual address space, each process is assigned
separate space (thanks to MMU)

>> For file backed mapping, especially code segment and library, kernel
>> will get a clue from the dynamic loader. If you analyze a binary,
>> let's say /bin/cat using readelf -S, you'll see that ELF denotes where
>> those parts of code need to be loaded and mapped in virtual memory
>
> Any idea why this hinting would be required?
> How does it matter where the code of the elf is loaded?

because most likely the code of the binary and the related libraries
are not relocatable, thus they must be loaded at exact location.
However, AFAIK, some libraries are now compiled as Position Independen
Code (using gcc's -fPIE flag), thus they can be loaded anywhere in
address space and still can operate correctly.

The rest are just the usual GOT and PLT table building...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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