aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-01-12 22:49:36 +0100
committerMichał Górny <mgorny@gentoo.org>2020-01-22 17:04:54 +0100
commit3215f7c7a81ffc7e6c0e49b21a4d4a01a2d945be (patch)
treeed3c154777f2513b58b018042fdb628646b8894e /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentd1dbb5e4718a8f845abf0783513a33a55429470b (diff)
downloadllvm-3215f7c7a81ffc7e6c0e49b21a4d4a01a2d945be.zip
llvm-3215f7c7a81ffc7e6c0e49b21a4d4a01a2d945be.tar.gz
llvm-3215f7c7a81ffc7e6c0e49b21a4d4a01a2d945be.tar.bz2
[compiler-rt] [builtins] Fix clear_cache_test to work with MPROTECT
Fix clear_cache_test to work on NetBSD with PaX MPROTECT enabled, that is when creating W+X mmaps is prohibited. Use the recommended solution: create two mappings for the same memory area, make one of them RW, while the other RX. Copy the function into the RW area but run it from the RX area. In order to implement this, I've split the pointer variables to 'write_buffer' and 'execution_buffer'. Both are separate pointers on NetBSD, while they have the same value on other systems. I've also split the memcpy_f() into two: new memcpy_f() that only takes care of copying memory and discards the (known) result of memcpy(), and realign_f() that applies ARM realignment to the given pointer. Again, there should be no difference on non-NetBSD systems but on NetBSD copying is done on write_buffer, while realignment on pointer to the execution_buffer. I have tested this change on NetBSD and Linux. Differential Revision: https://reviews.llvm.org/D72578
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
0 files changed, 0 insertions, 0 deletions