[llvm-commits] [llvm] r118728 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Rafael Espindola
rafael.espindola at gmail.com
Wed Nov 10 14:34:07 PST 2010
Author: rafael
Date: Wed Nov 10 16:34:07 2010
New Revision: 118728
URL: http://llvm.org/viewvc/llvm-project?rev=118728&view=rev
Log:
Update the section index map after we add the medatada sections.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=118728&r1=118727&r2=118728&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Wed Nov 10 16:34:07 2010
@@ -1253,6 +1253,9 @@
const_cast<MCAsmLayout&>(Layout),
SectionIndexMap);
+ // Update to include the metadata sections.
+ ComputeIndexMap(Asm, SectionIndexMap);
+
// Add 1 for the null section.
unsigned NumSections = Asm.size() + 1;
uint64_t NaturalAlignment = Is64Bit ? 8 : 4;
@@ -1335,6 +1338,7 @@
SectionKind::getReadOnly(),
false);
sh_link = SectionIndexMap[SymtabSection];
+ assert(sh_link && ".symtab not found");
// Remove ".rel" and ".rela" prefixes.
unsigned SecNameLen = (Section.getType() == ELF::SHT_REL) ? 4 : 5;
More information about the llvm-commits
mailing list