1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

DynamicLoader: Always make .data segment read+write

Let's just ignore the program header and always go with read+write.
Nothing else makes sense anyway.
This commit is contained in:
Andreas Kling 2021-02-20 19:02:15 +01:00
parent 81c6d8e98e
commit 08476e7fe7
2 changed files with 1 additions and 11 deletions

View file

@ -372,7 +372,7 @@ void DynamicLoader::load_program_headers()
auto* data_segment = (u8*)mmap_with_name(
data_segment_address,
data_segment_size,
data_region.value().mmap_prot(),
PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED,
0,
0,
@ -575,15 +575,6 @@ void DynamicLoader::call_object_init_functions()
}
}
u32 DynamicLoader::ProgramHeaderRegion::mmap_prot() const
{
int prot = 0;
prot |= is_executable() ? PROT_EXEC : 0;
prot |= is_readable() ? PROT_READ : 0;
prot |= is_writable() ? PROT_WRITE : 0;
return prot;
}
Optional<DynamicObject::SymbolLookupResult> DynamicLoader::lookup_symbol(const ELF::DynamicObject::Symbol& symbol) const
{
return m_dynamic_object->lookup_symbol(symbol);