Merge pull request #453 from Sonicadvance1/32bit_searchpath

Updates ELFSymbolDatabase for 32bit library paths
This commit is contained in:
Ryan Houdek authored and GitHub committed 2020-10-07 11:08:38 -07:00
commit 867955b9a0
1 file changed
+10 -3
+10 -3
View File
@@ -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");