diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-02-11 22:41:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-02-11 22:41:26 +0000 |
commit | fbd0ddf08272ddcd6067e0826d39d50efbc1be24 (patch) | |
tree | 3edb318c5b13d8df8674317497f7e2e62acad0f7 /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | 1bebad1b865c5de81c9c7bb4ad10ca0489bcdd68 (diff) | |
download | bcm5719-llvm-fbd0ddf08272ddcd6067e0826d39d50efbc1be24.tar.gz bcm5719-llvm-fbd0ddf08272ddcd6067e0826d39d50efbc1be24.zip |
Don't recompute the entire section map just to add 3 entries. NFC.
llvm-svn: 228881
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 4672c4d5cef..c6033e2fd43 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -1409,23 +1409,23 @@ void ELFObjectWriter::CreateMetadataSections(MCAssembler &Asm, Ctx.getELFSection(".shstrtab", ELF::SHT_STRTAB, 0); MCSectionData &ShstrtabSD = Asm.getOrCreateSectionData(*ShstrtabSection); ShstrtabSD.setAlignment(1); + ShstrtabIndex = SectionIndexMap.size() + 1; + SectionIndexMap[ShstrtabSection] = ShstrtabIndex; const MCSectionELF *SymtabSection = Ctx.getELFSection(".symtab", ELF::SHT_SYMTAB, 0, EntrySize, ""); MCSectionData &SymtabSD = Asm.getOrCreateSectionData(*SymtabSection); SymtabSD.setAlignment(is64Bit() ? 8 : 4); + SymbolTableIndex = SectionIndexMap.size() + 1; + SectionIndexMap[SymtabSection] = SymbolTableIndex; const MCSectionELF *StrtabSection; StrtabSection = Ctx.getELFSection(".strtab", ELF::SHT_STRTAB, 0); MCSectionData &StrtabSD = Asm.getOrCreateSectionData(*StrtabSection); StrtabSD.setAlignment(1); - - ComputeIndexMap(Asm, SectionIndexMap, RelMap); - - ShstrtabIndex = SectionIndexMap.lookup(ShstrtabSection); - SymbolTableIndex = SectionIndexMap.lookup(SymtabSection); - StringTableIndex = SectionIndexMap.lookup(StrtabSection); + StringTableIndex = SectionIndexMap.size() + 1; + SectionIndexMap[StrtabSection] = StringTableIndex; // Symbol table F = new MCDataFragment(&SymtabSD); |