LLVM: llvm::ELFObjectWriter Class Reference (original) (raw)

#include "[llvm/MC/MCELFObjectWriter.h](MCELFObjectWriter%5F8h%5Fsource.html)"

Public Member Functions
ELFObjectWriter (std::unique_ptr< MCELFObjectTargetWriter > MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
ELFObjectWriter (std::unique_ptr< MCELFObjectTargetWriter > MOTW, raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS, bool IsLittleEndian)
void reset () override
lifetime management
void setAssembler (MCAssembler *Asm) override
void executePostLayoutBinding () override
Perform any late binding of symbols (for example, to assign symbol indices for use when generating relocations).
void recordRelocation (const MCFragment &F, const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue) override
Record a relocation entry.
bool isSymbolRefDifferenceFullyResolvedImpl (const MCSymbol &SymA, const MCFragment &FB, bool InSet, bool IsPCRel) const override
uint64_t writeObject () override
Write the object file and returns the number of bytes written.
bool hasRelocationAddend () const
bool usesRela (const MCTargetOptions *TO, const MCSectionELF &Sec) const
bool useSectionSymbol (const MCValue &Val, const MCSymbolELF *Sym, uint64_t C, unsigned Type) const
bool checkRelocation (SMLoc Loc, const MCSectionELF *From, const MCSectionELF *To)
unsigned getELFHeaderEFlags () const
void setELFHeaderEFlags (unsigned Flags)
void markGnuAbi ()
bool seenGnuAbi () const
void setOverrideABIVersion (uint8_t V)
Public Member Functions inherited from llvm::MCObjectWriter
MCObjectWriter (const MCObjectWriter &)=delete
MCObjectWriter & operator= (const MCObjectWriter &)=delete
virtual ~MCObjectWriter ()
MCContext & getContext () const
bool isSymbolRefDifferenceFullyResolved (const MCSymbol &A, const MCSymbol &B, bool InSet) const
Check whether the difference (A - B) between two symbol references is fully resolved.
MutableArrayRef< std::pair< std::string, size_t > > getFileNames ()
void addFileName (StringRef FileName)
void setCompilerVersion (StringRef CompilerVers)
void emitAddrsigSection ()
Tell the object writer to emit an address-significance table during writeObject().
bool getEmitAddrsigSection ()
void addAddrsigSymbol (const MCSymbol *Sym)
Record the given symbol in the address-significance table to be written diring writeObject().
std::vector< const MCSymbol * > & getAddrsigSyms ()
SmallVector< CGProfileEntry, 0 > & getCGProfile ()
bool getSubsectionsViaSymbols () const
void setSubsectionsViaSymbols (bool Value)
Public Attributes
std::unique_ptr< MCELFObjectTargetWriter > TargetObjectWriter
raw_pwrite_stream & OS
raw_pwrite_stream * DwoOS = nullptr
DenseMap< const MCSectionELF *, std::vector< ELFRelocationEntry > > Relocations
DenseMap< const MCSymbolELF *, const MCSymbolELF * > Renames
SmallVector< const MCSymbolELF *, 0 > Weakrefs
bool IsLittleEndian = false
bool SeenGnuAbi = false
std::optional< uint8_t > OverrideABIVersion
SmallVector< Symver, 0 > Symvers
Additional Inherited Members
Protected Member Functions inherited from llvm::MCObjectWriter
MCObjectWriter ()=default
Protected Attributes inherited from llvm::MCObjectWriter
MCAssembler * Asm = nullptr
SmallVector< std::pair< std::string, size_t >, 0 > FileNames
List of declared file names.
std::string CompilerVersion
std::vector< const MCSymbol * > AddrsigSyms
bool EmitAddrsigSection = false
bool SubsectionsViaSymbols = false
SmallVector< CGProfileEntry, 0 > CGProfile

Definition at line 142 of file MCELFObjectWriter.h.

ELFObjectWriter() [2/2]

checkRelocation()

executePostLayoutBinding()

void ELFObjectWriter::executePostLayoutBinding ( ) overridevirtual

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.

Reimplemented from llvm::MCObjectWriter.

Definition at line 1172 of file ELFObjectWriter.cpp.

References llvm::MCObjectWriter::AddrsigSyms, llvm::MCObjectWriter::Asm, assert(), llvm::MCSymbolRefExpr::create(), llvm::dyn_cast(), llvm::StringRef::find(), llvm::MCSection::getBeginSymbol(), llvm::MCSymbol::getName(), llvm::MCSymbol::getSection(), llvm::MCSymbol::isInSection(), llvm::StringRef::npos, Renames, llvm::MCSymbol::setUsedInReloc(), llvm::StringRef::starts_with(), llvm::ELF::STB_WEAK, llvm::StringRef::substr(), Symvers, llvm::CallingConv::Tail, and Weakrefs.

getELFHeaderEFlags()

unsigned llvm::ELFObjectWriter::getELFHeaderEFlags ( ) const inline

hasRelocationAddend()

bool ELFObjectWriter::hasRelocationAddend ( ) const

isSymbolRefDifferenceFullyResolvedImpl()

markGnuAbi()

void llvm::ELFObjectWriter::markGnuAbi ( ) inline

recordRelocation()

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().

Reimplemented from llvm::MCObjectWriter.

Definition at line 1313 of file ELFObjectWriter.cpp.

References llvm::MCObjectWriter::Asm, assert(), checkRelocation(), DwoOS, F, llvm::FirstLiteralRelocationKind, Fixup, llvm::MCSection::getBeginSymbol(), llvm::MCObjectWriter::getContext(), llvm::mc::isRelocRelocation(), Relocations, Renames, llvm::ELF::STB_LOCAL, TargetObjectWriter, useSectionSymbol(), and usesRela().

reset()

void ELFObjectWriter::reset ( ) overridevirtual

seenGnuAbi()

bool llvm::ELFObjectWriter::seenGnuAbi ( ) const inline

setAssembler()

void ELFObjectWriter::setAssembler ( MCAssembler * Asm) overridevirtual

setELFHeaderEFlags()

void llvm::ELFObjectWriter::setELFHeaderEFlags ( unsigned Flags) inline

setOverrideABIVersion()

void llvm::ELFObjectWriter::setOverrideABIVersion ( uint8_t V) inline

useSectionSymbol()

Definition at line 1247 of file ELFObjectWriter.cpp.

References llvm::CallingConv::C, llvm::ELF::EM_386, llvm::ELF::EM_MIPS, llvm::MCSectionELF::getFlags(), llvm::MCSymbol::getSection(), llvm::MCSymbolELF::getType(), hasRelocationAddend(), llvm::MCSymbol::isInSection(), llvm::ELF::SHF_MERGE, llvm::ELF::SHF_TLS, llvm::ELF::STT_GNU_IFUNC, and TargetObjectWriter.

Referenced by recordRelocation().

usesRela()

writeObject()

uint64_t ELFObjectWriter::writeObject ( ) overridevirtual

DwoOS

IsLittleEndian

bool llvm::ELFObjectWriter::IsLittleEndian = false

OS

OverrideABIVersion

std::optional<uint8_t> llvm::ELFObjectWriter::OverrideABIVersion

Relocations

Renames

SeenGnuAbi

bool llvm::ELFObjectWriter::SeenGnuAbi = false

Symvers

TargetObjectWriter

Weakrefs


The documentation for this class was generated from the following files: