ELF_STB_Local is 0 so setting and checking it must be done specially

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Roman Divacky 2010-09-08 18:08:40 +00:00
parent 30268be89d
commit b629dcca72
2 changed files with 5 additions and 3 deletions

View File

@ -439,7 +439,7 @@ void ELFObjectWriterImpl::WriteSymbolTable(MCDataFragment *F,
assert((Data.getFlags() & ELF_STB_Global) &&
"External symbol requires STB_GLOBAL flag");
WriteSymbol(F, MSD, Layout);
if (Data.getFlags() & ELF_STB_Local)
if ((Data.getFlags() & (0xf << ELF_STB_Shift)) == ELF_STB_Local)
LastLocalSymbolIndex++;
}
@ -448,7 +448,7 @@ void ELFObjectWriterImpl::WriteSymbolTable(MCDataFragment *F,
MCSymbolData &Data = *MSD.SymbolData;
Data.setFlags(Data.getFlags() | ELF_STB_Global);
WriteSymbol(F, MSD, Layout);
if (Data.getFlags() & ELF_STB_Local)
if ((Data.getFlags() & (0xf << ELF_STB_Shift)) == ELF_STB_Local)
LastLocalSymbolIndex++;
}
}

View File

@ -196,7 +196,9 @@ void MCELFStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
break;
case MCSA_Local:
SD.setFlags(SD.getFlags() | ELF_STB_Local);
// ELF_STB_Local is 0, so zero the ELF_STB area
// SD.getFlags() | ELF_STB_Local is a NOP
SD.setFlags(SD.getFlags() & ~(0xf << ELF_STB_Shift));
break;
case MCSA_ELF_TypeFunction: