mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +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
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…
Add table
Add a link
Reference in a new issue