doesSectionRequireSymbols is meaningless on ELF, remove.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 6 Feb 2014 00:54:53 +0000 (00:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 6 Feb 2014 00:54:53 +0000 (00:54 +0000)
This is a nop. doesSectionRequireSymbols is only used from
isSymbolLinkerVisible. isSymbolLinkerVisible only use from ELF was in

if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined())
  return false;

if (Symbol.isTemporary())
  return false;

If the symbol is a temporary this code returns false and it is irrelevant if
we take the first if or not. If the symbol is not a temporary,
Asm.isSymbolLinkerVisible returns true without ever calling
doesSectionRequireSymbols.

This was an horrible leftover from when support for ELF was first added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200894 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/ELFObjectWriter.cpp
lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp

index f6dbfced54012ff67ca5ab96222f9267f265faff..8b2ab02bec5a29160c4f199b627e679b427fe2f1 100644 (file)
@@ -848,9 +848,6 @@ bool ELFObjectWriter::isInSymtab(const MCAssembler &Asm,
   if (!Symbol.isVariable() && Symbol.isUndefined() && !IsGlobal)
     return false;
 
-  if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined())
-    return false;
-
   if (Symbol.isTemporary())
     return false;
 
index dfd8a658bd47dddbfebae2a97034846bf59d202c..1260208f40d91f1b4b350635b199f864e174b182 100644 (file)
@@ -350,11 +350,6 @@ public:
     : X86AsmBackend(T, CPU), OSABI(_OSABI) {
     HasReliableSymbolDifference = true;
   }
-
-  virtual bool doesSectionRequireSymbols(const MCSection &Section) const {
-    const MCSectionELF &ES = static_cast<const MCSectionELF&>(Section);
-    return ES.getFlags() & ELF::SHF_MERGE;
-  }
 };
 
 class ELFX86_32AsmBackend : public ELFX86AsmBackend {