mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibELF: Use shared memory mapping when loading ELF objects
There's no reason to make a private read-only mapping just for reading (and validating) the ELF headers, and copying out the data segments.
This commit is contained in:
parent
8e0387e674
commit
c482508aa1
Notes:
sideshowbarker
2024-07-17 20:51:33 +09:00
Author: https://github.com/awesomekling
Commit: c482508aa1
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> DynamicLoader::try_create(i
|
|||
return DlErrorMessage { String::formatted("File {} has invalid ELF header", filename) };
|
||||
|
||||
String file_mmap_name = String::formatted("ELF_DYN: {}", filename);
|
||||
auto* data = mmap_with_name(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0, file_mmap_name.characters());
|
||||
auto* data = mmap_with_name(nullptr, size, PROT_READ, MAP_SHARED, fd, 0, file_mmap_name.characters());
|
||||
if (data == MAP_FAILED) {
|
||||
return DlErrorMessage { "DynamicLoader::try_create mmap" };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue