diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp b/contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp index db45aef7d5..b2ead90bf8 100644 --- a/contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp +++ b/contrib/libs/llvm12/lib/MC/MCELFStreamer.cpp @@ -224,31 +224,31 @@ bool MCELFStreamer::emitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) { break; case MCSA_Global: - // For `.weak x; .global x`, GNU as sets the binding to STB_WEAK while we - // traditionally set the binding to STB_GLOBAL. This is error-prone, so we - // error on such cases. Note, we also disallow changed binding from .local. - if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_GLOBAL) - getContext().reportError(getStartTokLoc(), - Symbol->getName() + - " changed binding to STB_GLOBAL"); + // For `.weak x; .global x`, GNU as sets the binding to STB_WEAK while we + // traditionally set the binding to STB_GLOBAL. This is error-prone, so we + // error on such cases. Note, we also disallow changed binding from .local. + if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_GLOBAL) + getContext().reportError(getStartTokLoc(), + Symbol->getName() + + " changed binding to STB_GLOBAL"); Symbol->setBinding(ELF::STB_GLOBAL); break; case MCSA_WeakReference: case MCSA_Weak: - // For `.global x; .weak x`, both MC and GNU as set the binding to STB_WEAK. - // We emit a warning for now but may switch to an error in the future. - if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_WEAK) - getContext().reportWarning( - getStartTokLoc(), Symbol->getName() + " changed binding to STB_WEAK"); + // For `.global x; .weak x`, both MC and GNU as set the binding to STB_WEAK. + // We emit a warning for now but may switch to an error in the future. + if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_WEAK) + getContext().reportWarning( + getStartTokLoc(), Symbol->getName() + " changed binding to STB_WEAK"); Symbol->setBinding(ELF::STB_WEAK); break; case MCSA_Local: - if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_LOCAL) - getContext().reportError(getStartTokLoc(), - Symbol->getName() + - " changed binding to STB_LOCAL"); + if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_LOCAL) + getContext().reportError(getStartTokLoc(), + Symbol->getName() + + " changed binding to STB_LOCAL"); Symbol->setBinding(ELF::STB_LOCAL); break; @@ -304,7 +304,7 @@ void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size, auto *Symbol = cast<MCSymbolELF>(S); getAssembler().registerSymbol(*Symbol); - if (!Symbol->isBindingSet()) + if (!Symbol->isBindingSet()) Symbol->setBinding(ELF::STB_GLOBAL); Symbol->setType(ELF::STT_OBJECT); @@ -336,8 +336,8 @@ void MCELFStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) { void MCELFStreamer::emitELFSymverDirective(StringRef AliasName, const MCSymbol *Aliasee) { - getAssembler().Symvers.push_back( - MCAssembler::Symver{AliasName, Aliasee, getStartTokLoc()}); + getAssembler().Symvers.push_back( + MCAssembler::Symver{AliasName, Aliasee, getStartTokLoc()}); } void MCELFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size, @@ -443,18 +443,18 @@ void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) { case MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO: case MCSymbolRefExpr::VK_PPC_GOT_TPREL_HI: case MCSymbolRefExpr::VK_PPC_GOT_TPREL_HA: - case MCSymbolRefExpr::VK_PPC_GOT_TPREL_PCREL: + case MCSymbolRefExpr::VK_PPC_GOT_TPREL_PCREL: case MCSymbolRefExpr::VK_PPC_GOT_DTPREL: case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_LO: case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HI: case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HA: case MCSymbolRefExpr::VK_PPC_TLS: - case MCSymbolRefExpr::VK_PPC_TLS_PCREL: + case MCSymbolRefExpr::VK_PPC_TLS_PCREL: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_LO: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HI: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HA: - case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_PCREL: + case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_PCREL: case MCSymbolRefExpr::VK_PPC_TLSGD: case MCSymbolRefExpr::VK_PPC_GOT_TLSLD: case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_LO: @@ -492,7 +492,7 @@ void MCELFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) { // Not a temporary, referece it as a weak undefined. bool Created; getAssembler().registerSymbol(*S, &Created); - if (Created) + if (Created) cast<MCSymbolELF>(S)->setBinding(ELF::STB_WEAK); } |