llvm::MachObjectWriter

Mach-O object writer that emits Mach-O object files from an MCAssembler.

Synopsis

Declared in <llvm/MC/MCMachObjectWriter.h>

class MachObjectWriter final
    : public MCObjectWriter

Base Classes

NameDescription
MCObjectWriterDefines the object file and target independent interfaces used by the assembler backend to write native file format object files.

Types

NameDescription
DataRegionData A data-in-code or similar region delimited by start and end symbols.
VersionInfoType Deployment-target or build-version information for a Mach-O load command.

Type Aliases

NameDescription
VersionInfoType Deployment-target or build-version information for a Mach-O load command.

Member Functions

NameDescription
MachObjectWriter [constructor]Construct a Mach-O object writer for the given target and stream.
operator= [deleted]Deleted copy assignment operator.
addAddrsigSymbol Record the given symbol in the address-significance table to be written diring writeObject().
addFileName Append a declared input file name.
addRelocation Add a relocation to be output in the object file.
bindIndirectSymbols Bind indirect symbols and assign their symbol table indices.
computeSectionAddresses Compute file and virtual addresses for each section.
computeSymbolTable Compute the symbol table data.
doesSymbolRequireExternRelocation Return true if symbol S requires an external relocation.
emitAddrsigSection Request emission of an address-significance table.
executePostLayoutBinding [virtual]Perform late Mach-O symbol binding after layout.
findAliasedSymbol Return the non-aliased symbol that Sym ultimately refers to.
getAddrsigSyms Return the symbols recorded for the address-significance table.
getAtom Return the atom containing symbol S, or null if none.
getCGProfile Return the call-graph profile entries to emit.
getContext Get the MC context associated with the assembler.
getDataRegions Return the list of data regions to emit.
getEmitAddrsigSection Return whether an address-significance section will be emitted.
getFileNames Return the list of declared input file names.
getFragmentAddress Return the address of Fragment within the object layout.
getIndirectSymbols Return the list of indirect symbols to emit.
getLOHContainer Return the linker optimization hint container.
getLinkerOptions Return the linker options collected for LC_LINKER_OPTION.
getPaddingSize Return the padding inserted after section SD.
getSectionAddress Return the address assigned to section Sec.
getSectionOrder Return sections in layout order.
getSubsectionsViaSymbols Return whether Mach-O .subsections_via_symbols is enabled.
getSymbolAddress Return the address of symbol S in the object layout.
is64Bit Return true if the target writer is for 64-bit Mach-O.
isSymbolRefDifferenceFullyResolved Check whether the difference (A - B) between two symbol references is fully resolved.
isSymbolRefDifferenceFullyResolvedImpl [virtual]Check whether the difference between SymA and FB is fully resolved.
isX86_64 Return true if the target writer is for x86_64.
populateAddrSigSection Populate the address-significance section from Asm.
recordRelocation [virtual]Record a Mach-O relocation for fixup Fixup in fragment F.
reset [virtual]Reset writer state for reuse.
setAssembler setAssembler overloads
setBuildVersion Set the LC_BUILD_VERSION load command contents.
setCompilerVersion Set the optional compiler version string (XCOFF).
setSubsectionsViaSymbols Enable or disable Mach-O .subsections_via_symbols.
setTargetTriple Record the target triple string for emission.
setTargetVariantBuildVersion Set the target-variant LC_BUILD_VERSION load command contents.
setVersionMin Mach-O deployment target version information.
writeDysymtabLoadCommand Write an LC_DYSYMTAB load command.
writeHeader Write the Mach-O object file header.
writeLinkeditLoadCommand Write a linkedit-data style load command.
writeLinkerOptionsLoadCommand Write an LC_LINKER_OPTION load command for Options.
writeNlist Write one nlist entry for MSD.
writeObject [virtual]Write the Mach-O object file and return the number of bytes written.
writeSection Write a section header for Sec.
writeSegmentLoadCommand Write a segment load command.
writeSymtabLoadCommand Write an LC_SYMTAB load command.

Data Members

NameDescription
W Endian-aware writer used for Mach-O payload emission.

Protected Types

NameDescription
CGProfileEntry One call-graph profile edge with a from/to pair and edge weight.

Protected Data Members

NameDescription
AddrsigSyms Symbols to record in the address-significance table.
Asm Assembler that owns this object writer, or null if unset.
CGProfile Accumulated call-graph profile edges to emit.
CompilerVersion Optional compiler version string (XCOFF-specific).
EmitAddrsigSection True if an address-significance section should be emitted.
FileNames List of declared file names
SubsectionsViaSymbols True if Mach-O .subsections_via_symbols is enabled.