COFF: hoist a local variable

Create a local variable for the rdata section.  NFC.

llvm-svn: 279407
This commit is contained in:
Saleem Abdulrasool 2016-08-21 23:05:43 +00:00
parent 89e375a95e
commit 9f8bc029bd

View File

@ -286,25 +286,29 @@ void Writer::createSections() {
}
void Writer::createMiscChunks() {
OutputSection *RData = createSection(".rdata");
// Create thunks for locally-dllimported symbols.
if (!Symtab->LocalImportChunks.empty()) {
OutputSection *Sec = createSection(".rdata");
for (Chunk *C : Symtab->LocalImportChunks)
Sec->addChunk(C);
RData->addChunk(C);
}
// Create SEH table. x86-only.
if (Config->Machine != I386)
return;
std::set<Defined *> Handlers;
for (lld::coff::ObjectFile *File : Symtab->ObjectFiles) {
if (!File->SEHCompat)
return;
for (SymbolBody *B : File->SEHandlers)
Handlers.insert(cast<Defined>(B->repl()));
}
SEHTable.reset(new SEHTableChunk(Handlers));
createSection(".rdata")->addChunk(SEHTable.get());
RData->addChunk(SEHTable.get());
}
// Create .idata section for the DLL-imported symbol table.