From 6c729993a8b642a626797775058e0aacb1c4df53 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 19 Apr 2021 19:35:02 +0200 Subject: 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 --- Userland/Libraries/LibELF/DynamicLoader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Userland/Libraries/LibELF') 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(); -- cgit v1.2.3