From 36d9d9a7c5f5a88165f748a718a35e513277e283 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 6 Oct 2020 20:14:10 -0700 Subject: [PATCH] Updates ELFSymbolDatabase for 32bit library paths Doesn't really matter but let's put it there --- External/SonicUtils/Source/ELFSymbolDatabase.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/External/SonicUtils/Source/ELFSymbolDatabase.cpp b/External/SonicUtils/Source/ELFSymbolDatabase.cpp index 6a7575ac2..c897842a5 100644 --- a/External/SonicUtils/Source/ELFSymbolDatabase.cpp +++ b/External/SonicUtils/Source/ELFSymbolDatabase.cpp @@ -13,9 +13,16 @@ namespace ELFLoader { void ELFSymbolDatabase::FillLibrarySearchPaths() { // XXX: Open /etc/ld.so.conf and parse the paths in that file // For now I'm just filling with regular search paths - LibrarySearchPaths.emplace_back("/usr/local/lib/x86_64-linux-gnu"); - LibrarySearchPaths.emplace_back("/lib/x86_64-linux-gnu"); - LibrarySearchPaths.emplace_back("/usr/lib/x86_64-linux-gnu"); + if (File->GetMode() == ELFContainer::MODE_64BIT) { + LibrarySearchPaths.emplace_back("/usr/local/lib/x86_64-linux-gnu"); + LibrarySearchPaths.emplace_back("/lib/x86_64-linux-gnu"); + LibrarySearchPaths.emplace_back("/usr/lib/x86_64-linux-gnu"); + } + else { + LibrarySearchPaths.emplace_back("/usr/local/lib/i386-linux-gnu"); + LibrarySearchPaths.emplace_back("/lib/i386-linux-gnu"); + LibrarySearchPaths.emplace_back("/usr/lib/i386-linux-gnu"); + } // At least we can scan LD_LIBRARY_PATH auto EnvVar = getenv("LD_LIBRARY_PATH");