From ca9c53c1a8880286265b59d968267e771a4ed117 Mon Sep 17 00:00:00 2001 From: Peter Bindels Date: Fri, 16 Jul 2021 11:55:01 +0200 Subject: [PATCH] LibELF/DynamicLinker: Evaluate symbols in library insertion order (#8802) When loading libraries, it is required that each library uses the same instance of each symbol, and that they use the one from the executable if any. This is barely noticeable if done incorrectly; except that it completely breaks RTTI on Clang. This switches the hash map to be ordered; tested to work for Clang by @Bertaland --- Userland/Libraries/LibELF/DynamicLinker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp index 2aaa5b4175..fc01a4382a 100644 --- a/Userland/Libraries/LibELF/DynamicLinker.cpp +++ b/Userland/Libraries/LibELF/DynamicLinker.cpp @@ -34,7 +34,7 @@ namespace ELF { static HashMap> s_loaders; static String s_main_program_name; -static HashMap> s_global_objects; +static OrderedHashMap> s_global_objects; using EntryPointFunction = int (*)(int, char**, char**); using LibCExitFunction = void (*)(int);