diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-31 16:30:26 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-31 16:46:16 +0200 |
commit | 0819f0a3fd6a99700d2b64f125295721b20fd203 (patch) | |
tree | 410b2f44e3b6809d83a774ae3aac09062ca273f9 /Userland/Libraries/LibELF/DynamicLoader.cpp | |
parent | c853bc2ba681432d550ca8622a8158306e877fd5 (diff) | |
download | serenity-0819f0a3fd6a99700d2b64f125295721b20fd203.zip |
LibELF: Allow (but ignore) PT_LOAD headers with zero size
GNU ld sometimes generates zero-sized PT_LOAD headers when running with
the "-z separate-code" option. Let's not choke on such headers, we can
just ignore them and move along.
Diffstat (limited to 'Userland/Libraries/LibELF/DynamicLoader.cpp')
-rw-r--r-- | Userland/Libraries/LibELF/DynamicLoader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp index df5c4b35f6..301b595b08 100644 --- a/Userland/Libraries/LibELF/DynamicLoader.cpp +++ b/Userland/Libraries/LibELF/DynamicLoader.cpp @@ -260,6 +260,8 @@ void DynamicLoader::load_program_headers() VERIFY(!tls_region.has_value()); tls_region = region; } else if (region.is_load()) { + if (region.size_in_memory() == 0) + return; load_regions.append(region); if (region.is_executable()) { text_regions.append(region); |