[cfe-dev] How does works the allocation of a writable/readable segment in ELF?

Sean Silva chisophugis at gmail.com
Thu Apr 10 11:20:46 PDT 2014


This question isn't on-topic for this list (we're compiler devs, not kernel
devs). If you want to look at exactly how this works you can check out the
linux source code <
https://github.com/torvalds/linux/blob/master/fs/binfmt_elf.c> or the
source code of various other kernels (*BSD, illumos, Haiku, Xv6 (might be
easiest)). IIRC that is where I learned about it.

-- Sean Silva


On Thu, Apr 10, 2014 at 1:30 AM, TheMask <lol.themask at gmail.com> wrote:

> A segment of *PT_LOAD* type, flags *PF_write | PF_read*, *p_filesiz = x*
> and
> *p_memsiz = x+y* it's up to the kernel allocate *p_memsiz*, correct? How
> does this allocation actually works? the kernel allocate *p_memsiz* and put
> the begging of this block memory on *p_vaddr* so that the write/read memory
> region of this segment is from *p_vaddr* up to *p_vaddr + p_memsiz*? if so,
> what values(address) is the kernel expecting at *p_vaddr* at time before it
> does the allocation?
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/How-does-works-the-allocation-of-a-writable-readable-segment-in-ELF-tp4038806.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140410/ef60eac7/attachment.html>


More information about the cfe-dev mailing list