Struct object::write::Object [−][src]
Expand description
A writable object file.
Fields
flags: FileFlags
File flags that are specific to each file format.
mangling: Mangling
The symbol name mangling scheme.
Implementations
pub fn new(
format: BinaryFormat,
architecture: Architecture,
endian: Endianness
) -> Object<'a>
pub fn new(
format: BinaryFormat,
architecture: Architecture,
endian: Endianness
) -> Object<'a>
Create an empty object file.
Return the file format.
Return the architecture.
Specify the mangling setting.
Return the name for a standard segment.
This will vary based on the file format.
Get the section with the given SectionId
.
Mutably get the section with the given SectionId
.
Set the data for an existing section.
Must not be called for sections that already have data, or that contain uninitialized data.
Append data to an existing section. Returns the section offset of the data.
Append zero-initialized data to an existing section. Returns the section offset of the data.
Return the SectionId
of a standard section.
If the section doesn’t already exist then it is created.
pub fn add_section(
&mut self,
segment: Vec<u8>,
name: Vec<u8>,
kind: SectionKind
) -> SectionId
pub fn add_section(
&mut self,
segment: Vec<u8>,
name: Vec<u8>,
kind: SectionKind
) -> SectionId
Add a new section and return its SectionId
.
This also creates a section symbol.
Add a subsection. Returns the SectionId
and section offset of the data.
Get the COMDAT section group with the given ComdatId
.
Mutably get the COMDAT section group with the given ComdatId
.
Add a new COMDAT section group and return its ComdatId
.
Get the SymbolId
of the symbol with the given name.
Mutably get the symbol with the given SymbolId
.
Add a new symbol and return its SymbolId
.
Return true if the file format supports StandardSection::UninitializedTls
.
Return true if the file format supports StandardSection::Common
.
Add a new common symbol and return its SymbolId
.
For Mach-O, this appends the symbol to the __common
section.
Add a new file symbol and return its SymbolId
.
Get the symbol for a section.
Append data to an existing section, and update a symbol to refer to it.
For Mach-O, this also creates a __thread_vars
entry for TLS symbols, and the
symbol will indirectly point to the added data via the __thread_vars
entry.
Returns the section offset of the data.
Append zero-initialized data to an existing section, and update a symbol to refer to it.
For Mach-O, this also creates a __thread_vars
entry for TLS symbols, and the
symbol will indirectly point to the added data via the __thread_vars
entry.
Returns the section offset of the data.
Update a symbol to refer to the given data within a section.
For Mach-O, this also creates a __thread_vars
entry for TLS symbols, and the
symbol will indirectly point to the data via the __thread_vars
entry.
Convert a symbol to a section symbol and offset.
Returns None
if the symbol does not have a section.
Add a relocation to a section.
Relocations must only be added after the referenced symbols have been added and defined (if applicable).
Write the object to a WritableBuffer
.