mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibELF: Don't try to call mremap() on macOS
There is no mremap() on macOS. I'm just #ifdef'ing out the call here since I don't think the dynamic loader code matters on macOS anyway.
This commit is contained in:
parent
d0363bca01
commit
5c99296b92
Notes:
sideshowbarker
2024-07-19 00:27:50 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5c99296b92a
1 changed files with 2 additions and 0 deletions
|
@ -185,11 +185,13 @@ bool DynamicLoader::load_stage_2(unsigned flags, size_t total_tls_size)
|
|||
// dbg() << "Someone linked non -fPIC code into " << m_filename << " :(";
|
||||
ASSERT(m_text_segment_load_address.get() != 0);
|
||||
|
||||
#ifndef AK_OS_MACOS
|
||||
// Remap this text region as private.
|
||||
if (mremap(m_text_segment_load_address.as_ptr(), m_text_segment_size, m_text_segment_size, MAP_PRIVATE) == MAP_FAILED) {
|
||||
perror("mremap .text: MAP_PRIVATE");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (0 > mprotect(m_text_segment_load_address.as_ptr(), m_text_segment_size, PROT_READ | PROT_WRITE)) {
|
||||
perror("mprotect .text: PROT_READ | PROT_WRITE"); // FIXME: dlerror?
|
||||
|
|
Loading…
Reference in a new issue