Index: source/Core/ArchSpec.cpp =================================================================== --- source/Core/ArchSpec.cpp +++ source/Core/ArchSpec.cpp @@ -1002,6 +1002,26 @@ return IsEqualTo (rhs, false); } +static bool +isCompatibleEnvironment(llvm::Triple::EnvironmentType lhs, llvm::Triple::EnvironmentType rhs) +{ + if (lhs == rhs) + return true; + + // If any of the environment is unknown then they are compatible + if (lhs == llvm::Triple::UnknownEnvironment || rhs == llvm::Triple::UnknownEnvironment) + return true; + + // If one of the environment is Android and the other one is EABI then they are considered to + // be compatible. This is required as a workaround for shared libraries compiled for Android + // without the NOTE section indicating that they are using the Android ABI. + if ((lhs == llvm::Triple::Android && rhs == llvm::Triple::EABI) || + (rhs == llvm::Triple::Android && lhs == llvm::Triple::EABI)) + return true; + + return false; +} + bool ArchSpec::IsEqualTo (const ArchSpec& rhs, bool exact_match) const { @@ -1056,14 +1076,9 @@ const llvm::Triple::EnvironmentType lhs_triple_env = lhs_triple.getEnvironment(); const llvm::Triple::EnvironmentType rhs_triple_env = rhs_triple.getEnvironment(); - - if (lhs_triple_env != rhs_triple_env) - { - // Only fail if both environment types are not unknown - if (lhs_triple_env != llvm::Triple::UnknownEnvironment && - rhs_triple_env != llvm::Triple::UnknownEnvironment) - return false; - } + + if (!isCompatibleEnvironment(lhs_triple_env, rhs_triple_env)) + return false; return true; } return false; Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1740,12 +1740,9 @@ { DataExtractor data; - if (sheader.sh_type != SHT_ARM_ATTRIBUTES) - continue; - if (section_size == 0 || set_data(data, sheader.sh_offset, section_size) != section_size) - continue; - - ParseARMAttributes(data, section_size, arch_spec); + if (sheader.sh_type == SHT_ARM_ATTRIBUTES && section_size != 0 && + set_data(data, sheader.sh_offset, section_size) == section_size) + ParseARMAttributes(data, section_size, arch_spec); } if (name == g_sect_name_gnu_debuglink)