[MC] Delete STT_SECTION special cases from MCSymbolELF::setType and setBinding
authorFangrui Song <maskray@google.com>
Mon, 16 Dec 2019 04:32:08 +0000 (20:32 -0800)
committerFangrui Song <maskray@google.com>
Mon, 16 Dec 2019 04:39:25 +0000 (20:39 -0800)
The special cases added by rL293936 were no longer needed after rL296180
disallowed redefinition of section symbols.

llvm/lib/MC/MCSymbolELF.cpp

index a07c56c..1830b87 100644 (file)
@@ -40,8 +40,6 @@ 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,8 +91,6 @@ 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");