diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-02 03:09:06 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-02 03:09:06 +0000 |
commit | 6db8a9f3fabefeb00163295f0611d09134651f3f (patch) | |
tree | dca6d4004a208d63caaec83d13f42f863f40edaa /lib/MC/MCAssembler.cpp | |
parent | 052008bc3d288b44eae5c2e9abe8d78ffd891e2a (diff) |
The sections that the ELF object writer has to create are very simple and
contain only data. Handle them specially instead of using AddSectionToTheEnd.
This moves a hack from the generic assembler to the elf writer. It is also
a bit faster and should make other improvements easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 168b62073f..86bdca1c21 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -618,26 +618,6 @@ void MCAssembler::WriteSectionData(const MCSectionData *SD, assert(OW->getStream().tell() - Start == Layout.getSectionFileSize(SD)); } -void MCAssembler::AddSectionToTheEnd(const MCObjectWriter &Writer, - MCSectionData &SD, MCAsmLayout &Layout) { - // Create dummy fragments and assign section ordinals. - unsigned SectionIndex = size(); - SD.setOrdinal(SectionIndex); - - // Assign layout order indices to sections and fragments. - const MCFragment &Last = *Layout.getSectionOrder().back()->rbegin(); - unsigned FragmentIndex = Last.getLayoutOrder() + 1; - - SD.setLayoutOrder(Layout.getSectionOrder().size()); - for (MCSectionData::iterator it2 = SD.begin(), - ie2 = SD.end(); it2 != ie2; ++it2) { - it2->setLayoutOrder(FragmentIndex++); - } - Layout.getSectionOrder().push_back(&SD); - - Layout.LayoutSection(&SD); -} - void MCAssembler::Finish(MCObjectWriter *Writer) { DEBUG_WITH_TYPE("mc-dump", { llvm::errs() << "assembler backend - pre-layout\n--\n"; |