LLVM
8.0.1
|
Defines the object file and target independent interfaces used by the assembler backend to write native file format object files. More...
#include "llvm/MC/MCObjectWriter.h"
Public Member Functions | |
MCObjectWriter (const MCObjectWriter &)=delete | |
MCObjectWriter & | operator= (const MCObjectWriter &)=delete |
virtual | ~MCObjectWriter () |
virtual void | reset () |
lifetime management More... | |
High-Level API | |
virtual void | executePostLayoutBinding (MCAssembler &Asm, const MCAsmLayout &Layout)=0 |
Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations). More... | |
virtual void | recordRelocation (MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue)=0 |
Record a relocation entry. More... | |
bool | isSymbolRefDifferenceFullyResolved (const MCAssembler &Asm, const MCSymbolRefExpr *A, const MCSymbolRefExpr *B, bool InSet) const |
Check whether the difference (A - B) between two symbol references is fully resolved. More... | |
virtual bool | isSymbolRefDifferenceFullyResolvedImpl (const MCAssembler &Asm, const MCSymbol &A, const MCSymbol &B, bool InSet) const |
virtual bool | isSymbolRefDifferenceFullyResolvedImpl (const MCAssembler &Asm, const MCSymbol &SymA, const MCFragment &FB, bool InSet, bool IsPCRel) const |
virtual void | emitAddrsigSection () |
Tell the object writer to emit an address-significance table during writeObject(). More... | |
virtual void | addAddrsigSymbol (const MCSymbol *Sym) |
Record the given symbol in the address-significance table to be written diring writeObject(). More... | |
virtual uint64_t | writeObject (MCAssembler &Asm, const MCAsmLayout &Layout)=0 |
Write the object file and returns the number of bytes written. More... | |
Protected Member Functions | |
MCObjectWriter ()=default | |
Defines the object file and target independent interfaces used by the assembler backend to write native file format object files.
The object writer contains a few callbacks used by the assembler to allow the object writer to modify the assembler data structures at appropriate points. Once assembly is complete, the object writer is given the MCAssembler instance, which contains all the symbol and section data which should be emitted as part of writeObject().
Definition at line 40 of file MCObjectWriter.h.
|
protecteddefault |
|
delete |
|
virtualdefault |
Record the given symbol in the address-significance table to be written diring writeObject().
Definition at line 102 of file MCObjectWriter.h.
References writeObject().
Referenced by llvm::MCObjectStreamer::EmitAddrsigSym().
|
inlinevirtual |
Tell the object writer to emit an address-significance table during writeObject().
If this function is not called, all symbols are treated as address-significant.
Definition at line 98 of file MCObjectWriter.h.
Referenced by llvm::MCObjectStreamer::EmitAddrsig().
|
pure virtual |
Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations).
This routine is called by the assembler after layout and relaxation is complete.
Implemented in llvm::MachObjectWriter.
Referenced by llvm::MCAssembler::layout(), and reset().
bool MCObjectWriter::isSymbolRefDifferenceFullyResolved | ( | const MCAssembler & | Asm, |
const MCSymbolRefExpr * | A, | ||
const MCSymbolRefExpr * | B, | ||
bool | InSet | ||
) | const |
Check whether the difference (A - B) between two symbol references is fully resolved.
Clients are not required to answer precisely and may conservatively return false, even when a difference is fully resolved.
Definition at line 20 of file MCObjectWriter.cpp.
References llvm::MCSymbol::getFragment(), llvm::MCSymbolRefExpr::getKind(), llvm::MCSymbolRefExpr::getSymbol(), isSymbolRefDifferenceFullyResolvedImpl(), llvm::MCSymbol::isUndefined(), and llvm::MCSymbolRefExpr::VK_None.
Referenced by reset().
|
virtual |
Reimplemented in llvm::MachObjectWriter.
Definition at line 39 of file MCObjectWriter.cpp.
References llvm::MCSymbol::getFragment().
Referenced by encodeBase64StringEntry(), isSymbolRefDifferenceFullyResolved(), llvm::MachObjectWriter::isSymbolRefDifferenceFullyResolvedImpl(), isWeak(), and reset().
|
virtual |
Reimplemented in llvm::MachObjectWriter.
Definition at line 46 of file MCObjectWriter.cpp.
References llvm::MCFragment::getParent(), and llvm::MCSymbol::getSection().
|
delete |
|
pure virtual |
Record a relocation entry.
This routine is called by the assembler after layout and relaxation, and post layout binding. The implementation is responsible for storing information about the relocation so that it can be emitted during writeObject().
Implemented in llvm::MachObjectWriter.
Referenced by reset().
|
inlinevirtual |
lifetime management
Reimplemented in llvm::MachObjectWriter.
Definition at line 50 of file MCObjectWriter.h.
References llvm::HexStyle::Asm, B, executePostLayoutBinding(), Fixup, isSymbolRefDifferenceFullyResolved(), isSymbolRefDifferenceFullyResolvedImpl(), and recordRelocation().
Referenced by llvm::MachObjectWriter::reset(), and llvm::MCAssembler::reset().
|
pure virtual |
Write the object file and returns the number of bytes written.
This routine is called by the assembler after layout and relaxation is complete, fixups have been evaluated and applied, and relocations generated.
Implemented in llvm::MachObjectWriter.
Referenced by addAddrsigSymbol(), and llvm::MCAssembler::Finish().