diff options
| author | Michal Gorny <mgorny@gentoo.org> | 2018-12-23 15:09:28 +0000 |
|---|---|---|
| committer | Michal Gorny <mgorny@gentoo.org> | 2018-12-23 15:09:28 +0000 |
| commit | a939b40eae396881e8e0ee18c9e7f817a0377e25 (patch) | |
| tree | 996669051957576a0255ea5c965f657e53eae834 /compiler-rt/lib/xray | |
| parent | 470ce63251657e1370fedede313b70f15bf55774 (diff) | |
| download | bcm5719-llvm-a939b40eae396881e8e0ee18c9e7f817a0377e25.tar.gz bcm5719-llvm-a939b40eae396881e8e0ee18c9e7f817a0377e25.zip | |
[xray] Detect MPROTECT and error out when it's enabled (on NetBSD)
Add a CheckMPROTECT() routine to detect when pax MPROTECT is enabled
on NetBSD, and error xray out when it is. The solution is adapted
from existing CheckASLR().
Differential Revision: https://reviews.llvm.org/D56049
llvm-svn: 350030
Diffstat (limited to 'compiler-rt/lib/xray')
| -rw-r--r-- | compiler-rt/lib/xray/xray_init.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/xray_init.cc b/compiler-rt/lib/xray/xray_init.cc index d1c750f0c32..b0922aa8e37 100644 --- a/compiler-rt/lib/xray/xray_init.cc +++ b/compiler-rt/lib/xray/xray_init.cc @@ -67,6 +67,9 @@ void __xray_init() XRAY_NEVER_INSTRUMENT { if (atomic_load(&XRayInitialized, memory_order_acquire)) return; + // XRAY is not compatible with PaX MPROTECT + CheckMPROTECT(); + if (!atomic_load(&XRayFlagsInitialized, memory_order_acquire)) { initializeFlags(); atomic_store(&XRayFlagsInitialized, true, memory_order_release); |

