summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibELF/DynamicLoader.cpp
diff options
context:
space:
mode:
authorGunnar Beutner <gunnar@beutner.name>2021-04-19 19:35:02 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-19 20:39:22 +0200
commit6c729993a8b642a626797775058e0aacb1c4df53 (patch)
treeee5e76782abfeb901ef7dc43e0480f60784a72a8 /Userland/Libraries/LibELF/DynamicLoader.cpp
parent68d1469aea24bc0a3f812b65cabf16fcc8ddce83 (diff)
downloadserenity-6c729993a8b642a626797775058e0aacb1c4df53.zip
LibELF: Allow shared objects which don't have a text segment
Shared objects without a text segment are perfectly OK. For example libicudata.so has only data segments: Sections: Idx Name Size VMA LMA File off Algn 0 .hash 00000014 00000094 00000094 00000094 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .dynsym 00000020 000000a8 000000a8 000000a8 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .dynstr 0000002a 000000c8 000000c8 000000c8 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .rodata 01b562d0 00000100 00000100 00000100 2**4 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .eh_frame 00000000 01b563d0 01b563d0 01b563d0 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 5 .dynamic 00000070 01b573d0 01b573d0 01b563d0 2**2
Diffstat (limited to 'Userland/Libraries/LibELF/DynamicLoader.cpp')
-rw-r--r--Userland/Libraries/LibELF/DynamicLoader.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp
index 08681c08ad..942b5cf6f6 100644
--- a/Userland/Libraries/LibELF/DynamicLoader.cpp
+++ b/Userland/Libraries/LibELF/DynamicLoader.cpp
@@ -306,8 +306,7 @@ void DynamicLoader::load_program_headers()
return IterationDecision::Continue;
});
- VERIFY(!text_regions.is_empty());
- VERIFY(!data_regions.is_empty());
+ VERIFY(!text_regions.is_empty() || !data_regions.is_empty());
auto compare_load_address = [](ProgramHeaderRegion& a, ProgramHeaderRegion& b) {
return a.desired_load_address().as_ptr() < b.desired_load_address().as_ptr();