For Programmers: Free Programming Magazines  


Home > Archive > Compilers > January 2007 > pax (SEGMEXEC) mirroring









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author pax (SEGMEXEC) mirroring
rejithomas.d@gmail.com

2007-01-14, 10:08 pm

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]
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com