|
From: Tom H. <to...@co...> - 2016-06-20 12:01:09
|
On 20/06/16 09:56, Schmidt, Adriaan wrote: > I figured out that in native execution, my application only works because it states in its ELF header that it needs executable stacks, and Linux' way of providing this is with the READ_IMPLIES_EXEC property in the process personality, i.e., by simply making all readable memory also executable. Valgrind is more strict, and does not implement READ_IMPLIES_EXEC. > > Is this a bug, so should Valgrind show the same behavior as in native execution? Yes it's a bug. In your program ;-) Even without valgrind not all platforms will do what you say to start with - the only thing that PT_GNU_STACK in the ELF guarantees is that the stack will have those permissions and valgrind does do that. The read-implies-exec behaviour you describe is, in general, only true for those CPUs (like older 32 bit x86 and ARM) that don't actually support a separate execute permission. In the case of ARM that appears to mean things before ARMv6 as far as I can see. So your problem is quite likely to fail anyway when run on newer hardware so be glad valgrind has found your problem now ;-) Tom -- Tom Hughes (to...@co...) http://compton.nu/ |