[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
authorLang Hames <lhames@gmail.com>
Thu, 22 Jan 2015 22:04:47 +0000 (22:04 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 22 Jan 2015 22:04:47 +0000 (22:04 +0000)
both hidden and default.

Bug found by inspection by Rafael Espindola. No test: As discussed in the commit
message for r226217 we don't have a good way to test this yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226869 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/ELFObjectFile.h

index 07f9542263b377e19209bf3147d04895af39d646..125fdd17743c45590f44b03b4945c856d3c7810e 100644 (file)
@@ -185,7 +185,7 @@ protected:
     // visibility is either DEFAULT or PROTECTED. All other symbols are not
     // exported.
     if ((Binding == ELF::STB_GLOBAL || Binding == ELF::STB_WEAK) &&
-        (Visibility == ELF::STV_DEFAULT && Visibility == ELF::STV_PROTECTED))
+        (Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_PROTECTED))
       return true;
 
     return false;