mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-07 12:30:57 +00:00
[MC] Add interface to finish pending labels.
When manually finishing the object writer in dsymutil, it's possible that there are pending labels that haven't been resolved. This results in an assertion when the assembler tries to fixup a label that doesn't have an address yet. Differential revision: https://reviews.llvm.org/D49131 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7176a5d65f
commit
74dc40422c
@ -90,6 +90,9 @@ protected:
|
||||
public:
|
||||
void visitUsedSymbol(const MCSymbol &Sym) override;
|
||||
|
||||
/// Create a dummy fragment to assign any pending labels.
|
||||
void flushPendingLabels() { flushPendingLabels(nullptr); }
|
||||
|
||||
MCAssembler &getAssembler() { return *Assembler; }
|
||||
MCAssembler *getAssemblerPtr() override;
|
||||
/// \name MCStreamer Interface
|
||||
|
@ -671,6 +671,6 @@ void MCObjectStreamer::FinishImpl() {
|
||||
// Dump out the dwarf file & directory tables and line tables.
|
||||
MCDwarfLineTable::Emit(this, getAssembler().getDWARFLinetableParams());
|
||||
|
||||
flushPendingLabels(nullptr);
|
||||
flushPendingLabels();
|
||||
getAssembler().Finish();
|
||||
}
|
||||
|
@ -322,8 +322,10 @@ bool generateDsymCompanion(const DebugMap &DM, MCStreamer &MS,
|
||||
auto &ObjectStreamer = static_cast<MCObjectStreamer &>(MS);
|
||||
MCAssembler &MCAsm = ObjectStreamer.getAssembler();
|
||||
auto &Writer = static_cast<MachObjectWriter &>(MCAsm.getWriter());
|
||||
MCAsmLayout Layout(MCAsm);
|
||||
|
||||
// Layout but don't emit.
|
||||
ObjectStreamer.flushPendingLabels();
|
||||
MCAsmLayout Layout(MCAsm);
|
||||
MCAsm.layout(Layout);
|
||||
|
||||
BinaryHolder InputBinaryHolder(false);
|
||||
|
Loading…
Reference in New Issue
Block a user