|pax (SEGMEXEC) mirroring email@example.com (2007-01-14)|
|Date:||14 Jan 2007 22:24:33 -0500|
|Keywords:||architecture, code, question, comment|
|Posted-Date:||14 Jan 2007 22:24:33 EST|
I was going through the pax patch (SEGMEXEC) for linux. The patch uses
segmentation logic to prevent code being executed in the data segment
by marking data segment as non executable. My question is Pax does a
mirroring (vma mirroring) of the code segment in the data segment.Pax
documentation says that since the code can contain references to the
data in code section as in case of constant strings, function pointer
tables etc, the code segment should be mirrored at the same logical
address in the data segment as well.
q1:do constant strings and function pointer tables say VTable by
default goes into the text section of executable. or do I need to
explicitly tell the compiler to do so. What is the advantage in doing
q2: Why do we need a mirroring.
[Yes, it's common to put read-only data in the code segment. You need
to mirror it so that references to that data work. On machines with
limited address space, we carefully separated out the read-only data
into separate segments, but on today's computers it's not worth the
Return to the
Search the comp.compilers archives again.