On 12/22/2015 06:48 PM, Sebastian Lackner wrote:
Trying different optimization flags is one possibility. Alternatively, you could also try to remove static/inline or adding __volatile__ to the assembler code.
__volatile__ is already there. There is also a "memory" modifier in wld_mmap, and it is missing in wld_mprotect (docs suggest it is the direct hint for the compiler not to optimize out asm code). But unfortunately adding it to wld_mprotect does not solve the issue. I will play more with it and with the other options you suggest.