From ae37ff6b40af71391a7b41c5a1685f6c11187b37 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 11 Feb 2015 23:33:46 +0000 Subject: [PATCH] Use the existing SymbolTableIndex instead of doing a lookup. NFC. llvm-svn: 228888 --- lib/MC/ELFObjectWriter.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index bd86e610715..27b607f520e 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -1509,11 +1509,7 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm, case ELF::SHT_REL: case ELF::SHT_RELA: { - const MCSectionELF *SymtabSection; - const MCSectionELF *InfoSection; - SymtabSection = - Asm.getContext().getELFSection(".symtab", ELF::SHT_SYMTAB, 0); - sh_link = SectionIndexMap.lookup(SymtabSection); + sh_link = SymbolTableIndex; assert(sh_link && ".symtab not found"); // Remove ".rel" and ".rela" prefixes. @@ -1522,8 +1518,8 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm, StringRef GroupName = Section.getGroup() ? Section.getGroup()->getName() : ""; - InfoSection = Asm.getContext().getELFSection(SectionName, ELF::SHT_PROGBITS, - 0, 0, GroupName); + const MCSectionELF *InfoSection = Asm.getContext().getELFSection( + SectionName, ELF::SHT_PROGBITS, 0, 0, GroupName); sh_info = SectionIndexMap.lookup(InfoSection); break; }