diff options
Diffstat (limited to 'llvm/lib/MC/MCSymbolELF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSymbolELF.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSymbolELF.cpp b/llvm/lib/MC/MCSymbolELF.cpp index ec7ef447ff8..ffa8260d434 100644 --- a/llvm/lib/MC/MCSymbolELF.cpp +++ b/llvm/lib/MC/MCSymbolELF.cpp @@ -42,6 +42,8 @@ enum { void MCSymbolELF::setBinding(unsigned Binding) const { setIsBindingSet(); + if (getType() == ELF::STT_SECTION && Binding != ELF::STB_LOCAL) + setType(ELF::STT_NOTYPE); unsigned Val; switch (Binding) { default: @@ -93,6 +95,8 @@ unsigned MCSymbolELF::getBinding() const { void MCSymbolELF::setType(unsigned Type) const { unsigned Val; + if (Type == ELF::STT_SECTION && getBinding() != ELF::STB_LOCAL) + return; switch (Type) { default: llvm_unreachable("Unsupported Binding"); |