pax (SEGMEXEC) mirroring

rejithomas.d@gmail.com
14 Jan 2007 22:24:33 -0500

          From comp.compilers

Related articles
pax (SEGMEXEC) mirroring rejithomas.d@gmail.com (2007-01-14)
| List of all articles for this month |
From: rejithomas.d@gmail.com
Newsgroups: comp.compilers
Date: 14 Jan 2007 22:24:33 -0500
Organization: Compilers Central
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
this?


q2: Why do we need a mirroring.




Regards
Reji Thomas
[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
effort. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.