blob: 863e8606498b7540f0bf5be036394f371b968646 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
--- v8/src/execution/isolate.cc.orig 2023-04-05 11:05:06 UTC
+++ v8/src/execution/isolate.cc
@@ -146,6 +146,10 @@
#include "src/execution/simulator-base.h"
#endif
+#if defined(V8_OS_OPENBSD)
+#include <sys/mman.h>
+#endif
+
extern "C" const uint8_t v8_Default_embedded_blob_code_[];
extern "C" uint32_t v8_Default_embedded_blob_code_size_;
extern "C" const uint8_t v8_Default_embedded_blob_data_[];
@@ -3849,6 +3853,11 @@ void Isolate::InitializeDefaultEmbeddedBlob() {
uint32_t code_size = DefaultEmbeddedBlobCodeSize();
const uint8_t* data = DefaultEmbeddedBlobData();
uint32_t data_size = DefaultEmbeddedBlobDataSize();
+
+#if defined(V8_OS_OPENBSD) && !defined(V8_TARGET_ARCH_IA32)
+ mprotect(reinterpret_cast<void *>(const_cast<uint8_t *>(code)),
+ code_size, PROT_READ | PROT_EXEC);
+#endif
if (StickyEmbeddedBlobCode() != nullptr) {
base::MutexGuard guard(current_embedded_blob_refcount_mutex_.Pointer());
|