SmallString<256> Code;
raw_svector_ostream VecOS(Code);
getAssembler().getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);
- VecOS.flush();
// Add the fixups and data.
for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {
Triple::x86)
return;
- if (cast<MCSymbolCOFF>(Symbol)->isSafeSEH())
+ const MCSymbolCOFF *CSymbol = cast<MCSymbolCOFF>(Symbol);
+ if (CSymbol->isSafeSEH())
return;
MCSection *SXData = getContext().getObjectFileInfo()->getSXDataSection();
new MCSafeSEHFragment(Symbol, SXData);
getAssembler().registerSymbol(*Symbol);
- cast<MCSymbolCOFF>(Symbol)->setIsSafeSEH();
+ CSymbol->setIsSafeSEH();
+
+ // The Microsoft linker requires that the symbol type of a handler be
+ // function. Go ahead and oblige it here.
+ CSymbol->setType(COFF::IMAGE_SYM_DTYPE_FUNCTION
+ << COFF::SCT_COMPLEX_TYPE_SHIFT);
}
void MCWinCOFFStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) {
Size = std::max(Size, static_cast<uint64_t>(ByteAlignment));
}
- AssignSection(Symbol, nullptr);
-
getAssembler().registerSymbol(*Symbol);
Symbol->setExternal(true);
Symbol->setCommon(Size, ByteAlignment);
OS << " -aligncomm:\"" << Symbol->getName() << "\","
<< Log2_32_Ceil(ByteAlignment);
- OS.flush();
PushSection();
SwitchSection(MFI->getDrectveSection());
getAssembler().registerSymbol(*Symbol);
Symbol->setExternal(false);
- AssignSection(Symbol, Section);
-
if (ByteAlignment != 1)
new MCAlignFragment(ByteAlignment, /*Value=*/0, /*ValueSize=*/0,
ByteAlignment, Section);