File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 454
454
}],
455
455
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
456
456
or OS=="android"' , {
457
- 'cflags!' : [
458
- '-O2' ,
459
- '-Os' ,
460
- ],
461
- 'cflags' : [
462
- '-fdata-sections' ,
463
- '-ffunction-sections' ,
464
- '-O3' ,
465
- ],
466
457
'conditions' : [
467
458
[ 'gcc_version==44 and clang==0' , {
468
459
'cflags' : [
Original file line number Diff line number Diff line change @@ -115,11 +115,26 @@ void* OS::GetRandomMmapAddr() {
115
115
raw_addr &= V8_UINT64_C (0x3ffffffff000 );
116
116
#else
117
117
uint32_t raw_addr = V8::RandomPrivate (isolate);
118
+
119
+ raw_addr &= 0x3ffff000 ;
120
+
121
+ # ifdef __sun
122
+ // For our Solaris/illumos mmap hint, we pick a random address in the bottom
123
+ // half of the top half of the address space (that is, the third quarter).
124
+ // Because we do not MAP_FIXED, this will be treated only as a hint -- the
125
+ // system will not fail to mmap() because something else happens to already
126
+ // be mapped at our random address. We deliberately set the hint high enough
127
+ // to get well above the system's break (that is, the heap); Solaris and
128
+ // illumos will try the hint and if that fails allocate as if there were
129
+ // no hint at all. The high hint prevents the break from getting hemmed in
130
+ // at low values, ceding half of the address space to the system heap.
131
+ raw_addr += 0x80000000 ;
132
+ # else
118
133
// The range 0x20000000 - 0x60000000 is relatively unpopulated across a
119
134
// variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos
120
135
// 10.6 and 10.7.
121
- raw_addr &= 0x3ffff000 ;
122
136
raw_addr += 0x20000000 ;
137
+ # endif
123
138
#endif
124
139
return reinterpret_cast <void *>(raw_addr);
125
140
}
You can’t perform that action at this time.
0 commit comments