This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dynamically written code problem


> on my system, mmap is allocating in the 0x40000000 range, and malloc > is allocating at the brk (around 0x08000000). Is this different when > exec-shield is activated?

Yes.  mmap with PROT_EXEC set attempts to allocate as low as possible,
usually below the executable.
mmap without PROT_EXEC allocates as high as possible, below the stack.

So at least my function does not lose execute protection if mmap was used with PROT_EXEC. Thank you very much,


Paolo



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]