summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-02-11 23:33:46 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-02-11 23:33:46 +0000
commit62118a1fe328b0587875770afa357ace7c93a14a (patch)
treec40f3a48dc69201b7fa6f4fe4d407323f0915ebe /llvm/lib
parent30c5387983caa55c6b5796f208b8bd39a5705f84 (diff)
downloadbcm5719-llvm-62118a1fe328b0587875770afa357ace7c93a14a.tar.gz
bcm5719-llvm-62118a1fe328b0587875770afa357ace7c93a14a.zip
Use the existing SymbolTableIndex instead of doing a lookup. NFC.
llvm-svn: 228888
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index bd86e610715..27b607f520e 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud