Direct ELF writer for DWP output.

Synopsis

Declared in <llvm/DWP/DWP.h>

class DWPWriter;

Description

Section data is stored as zero‐copy StringRef chunks pointing to the mmap'd input files, plus an inline buffer for constructed data (emitIntValue). This avoids copying gigabytes of debug section data through the MC infrastructure (MCContext, MCAssembler, MCDataFragment allocation, layout, etc.).

Member Functions

Name

Description

DWPWriter [constructor]

Construct an empty DWP writer with default ELF metadata.

emitBytes

Zero‐copy: stores a reference to the input data without copying. Flushes any pending inline data first to preserve output order.

emitIntValue

Append Value encoded in Size bytes to the current section buffer.

getSectionBuffer

Return the pending inline buffer for section Id.

setIsLittleEndian

Set the endianness used when emitting integer values.

setIsWASM

Select WASM object output instead of ELF.

setMachine

Set the ELF e_machine value for the output object.

setOSABI

Set the ELF EI_OSABI value for the output object.

switchSection

Make Id the current section for subsequent emit calls.

write

Write the package using WASM or ELF format based on setIsWASM.

writeELF

Write accumulated sections as a minimal ELF relocatable object.

writeWASM

Write accumulated sections as a minimal WASM object with custom sections.

Non-Member Functions

Name

Description

write

Merge split DWARF inputs into Out, optionally writing the package.

Created with MrDocs