mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-11 16:37:42 +00:00
Avoid an extra loop over the sections.
Add string to the section header string table as we add sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236257 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b65870f3f5
commit
494f112fbc
@ -263,6 +263,7 @@ class ELFObjectWriter : public MCObjectWriter {
|
||||
|
||||
unsigned ELFObjectWriter::addToSectionTable(const MCSectionELF *Sec) {
|
||||
SectionTable.push_back(Sec);
|
||||
ShStrTabBuilder.add(Sec->getSectionName());
|
||||
return SectionTable.size();
|
||||
}
|
||||
|
||||
@ -1310,14 +1311,7 @@ void ELFObjectWriter::writeRelocations(const MCAssembler &Asm,
|
||||
const MCSectionELF *
|
||||
ELFObjectWriter::createSectionHeaderStringTable(MCAssembler &Asm) {
|
||||
const MCSectionELF *ShstrtabSection = SectionTable[ShstrtabIndex - 1];
|
||||
|
||||
Asm.getOrCreateSectionData(*ShstrtabSection);
|
||||
|
||||
for (MCSectionData &SD : Asm) {
|
||||
const MCSectionELF &Section =
|
||||
static_cast<const MCSectionELF &>(SD.getSection());
|
||||
ShStrTabBuilder.add(Section.getSectionName());
|
||||
}
|
||||
ShStrTabBuilder.finalize(StringTableBuilder::ELF);
|
||||
OS << ShStrTabBuilder.data();
|
||||
return ShstrtabSection;
|
||||
|
Loading…
x
Reference in New Issue
Block a user