Crate object

Source
Expand description

§object

The object crate provides a unified interface to working with object files across platforms. It supports reading relocatable object files and executable files, and writing relocatable object files and some executable files.

§Raw struct definitions

Raw structs are defined for: ELF, Mach-O, PE/COFF, XCOFF, archive. Types and traits for zerocopy support are defined in the pod and endian modules.

§Unified read API

The read module provides a unified read API using the read::Object trait. There is an implementation of this trait for read::File, which allows reading any file format, as well as implementations for each file format.

§Low level read API

The read submodules define helpers that operate on the raw structs. These can be used instead of the unified API, or in conjunction with it to access details that are not available via the unified API.

§Unified write API

The write module provides a unified write API for relocatable object files using write::Object. This does not support writing executable files.

§Low level write API

The write submodules define helpers for writing the raw structs.

§Build API

The build submodules define helpers for building object files, either from scratch or by modifying existing files.

§Shared definitions

The crate provides a number of definitions that are used by both the read and write APIs. These are defined at the top level module, but none of these are the main entry points of the crate.

Re-exports§

pub use endian::*;
pub use pod::*;
pub use read::*;

Modules§

archive
Archive definitions.
build
Interface for building object files.
elf
ELF definitions.
endian
Types for compile-time and run-time endianness.
macho
Mach-O definitions.
pe
PE/COFF definitions.
pod
Tools for converting file format structures to and from bytes.
read
Interface for reading object files.
write
Interface for writing object files.
xcoff
XCOFF definitions

Enums§

AddressSize
The size of an address value for an architecture.
Architecture
A CPU architecture.
BinaryFormat
A binary file format.
ComdatKind
The selection kind for a COMDAT section group.
FileFlags
File flags that are specific to each file format.
RelocationEncoding
Information about how the result of the relocation operation is encoded in the place.
RelocationFlags
Relocation fields that are specific to each file format and architecture.
RelocationKind
The operation used to calculate the result of the relocation.
SectionFlags
Section flags that are specific to each file format.
SectionKind
The kind of a section.
SegmentFlags
Segment flags that are specific to each file format.
SubArchitecture
A CPU sub-architecture.
SymbolFlags
Symbol flags that are specific to each file format.
SymbolKind
The kind of a symbol.
SymbolScope
A symbol scope.