diff --git a/include/llvm-c/lto.h b/include/llvm-c/lto.h index c57dfe7306d..74a070342e9 100644 --- a/include/llvm-c/lto.h +++ b/include/llvm-c/lto.h @@ -30,9 +30,10 @@ typedef enum { LTO_SYMBOL_DEFINITION_TENTATIVE = 0x00000200, LTO_SYMBOL_DEFINITION_WEAK = 0x00000300, LTO_SYMBOL_DEFINITION_UNDEFINED = 0x00000400, - LTO_SYMBOL_SCOPE_MASK = 0x00001800, + LTO_SYMBOL_SCOPE_MASK = 0x00003800, LTO_SYMBOL_SCOPE_INTERNAL = 0x00000800, LTO_SYMBOL_SCOPE_HIDDEN = 0x00001000, + LTO_SYMBOL_SCOPE_PROTECTED = 0x00002000, LTO_SYMBOL_SCOPE_DEFAULT = 0x00001800 } lto_symbol_attributes; diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index 7eb79053ea9..6331a59e02d 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -224,6 +224,8 @@ void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler, // set scope part if ( def->hasHiddenVisibility() ) attr |= LTO_SYMBOL_SCOPE_HIDDEN; + else if ( def->hasProtectedVisibility() ) + attr |= LTO_SYMBOL_SCOPE_PROTECTED; else if ( def->hasExternalLinkage() || def->hasWeakLinkage() || def->hasLinkOnceLinkage() || def->hasCommonLinkage() ) attr |= LTO_SYMBOL_SCOPE_DEFAULT;