mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-04 16:26:46 +00:00
COFF: hoist a local variable
Create a local variable for the rdata section. NFC. llvm-svn: 279407
This commit is contained in:
parent
89e375a95e
commit
9f8bc029bd
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user