[lld] r239706 - COFF: Set Chunk to OutputSection backreference in addChunk().
Rui Ueyama
ruiu at google.com
Sun Jun 14 15:16:47 PDT 2015
Author: ruiu
Date: Sun Jun 14 17:16:47 2015
New Revision: 239706
URL: http://llvm.org/viewvc/llvm-project?rev=239706&view=rev
Log:
COFF: Set Chunk to OutputSection backreference in addChunk().
When we add a chunk to an OutputSection, we always want to create
a backreference from an OutputSection to a Chunk. To make sure
we always do, do that in addChunk(). NFC.
Modified:
lld/trunk/COFF/Writer.cpp
Modified: lld/trunk/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=239706&r1=239705&r2=239706&view=diff
==============================================================================
--- lld/trunk/COFF/Writer.cpp (original)
+++ lld/trunk/COFF/Writer.cpp Sun Jun 14 17:16:47 2015
@@ -70,6 +70,7 @@ void OutputSection::setFileOffset(uint64
void OutputSection::addChunk(Chunk *C) {
Chunks.push_back(C);
+ C->setOutputSection(this);
uint64_t Off = Header.VirtualSize;
Off = RoundUpToAlignment(Off, C->getAlign());
C->setRVA(Off);
@@ -140,7 +141,6 @@ void Writer::createSections() {
}
std::vector<Chunk *> &Chunks = P.second;
for (Chunk *C : Chunks) {
- C->setOutputSection(Sec);
Sec->addChunk(C);
Sec->addPermissions(C->getPermissions());
}
More information about the llvm-commits
mailing list