summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/xray
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-12-23 15:09:28 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-12-23 15:09:28 +0000
commita939b40eae396881e8e0ee18c9e7f817a0377e25 (patch)
tree996669051957576a0255ea5c965f657e53eae834 /compiler-rt/lib/xray
parent470ce63251657e1370fedede313b70f15bf55774 (diff)
downloadbcm5719-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.cc3
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);
OpenPOWER on IntegriCloud