pub enum Section {
Show 43 variants
NOP,
Code(Code),
RunAtOffset(u16, u16),
SectionSwitch(u16),
BSS(u32),
Patch(Patch),
XDEF(XDEF),
XREF(XREF),
LNKHeader(LNKHeader),
LocalSymbol(LocalSymbol),
GroupSymbol(GroupSymbol),
ByteSizeRegister(u16),
WordSizeRegister(u16),
LongSizeRegister(u16),
Filename(Filename),
SetToFile(u16, u32),
SetToLine(u32),
IncrementLineNumber,
IncrementLineNumberByte(u8),
IncrementLineNumberWord(u32),
VeryLocalSymbol(LocalSymbol),
Set3ByteRegister(u16),
SetMXInfo(SetMXInfo),
CPU(u8),
XBSS(XBSS),
IncSLDLineNum(u16),
IncSLDLineNumByte(u16, u8),
IncSLDLineNumWord(u16, u32),
SetSLDLineNum(SetSLDLineNum),
SetSLDLineNumFile(SetSLDLineNumFile),
EndSLDInfo(u16),
RepeatByte(u32),
RepeatWord(u32),
RepeatLong(u32),
ProcedureCall(ProcedureCall),
ProcedureDefinition(ProcedureDefinition),
Repeat3Byte(u32),
FunctionStart(FunctionStart),
FunctionEnd(SectionOffsetLine),
BlockStart(SectionOffsetLine),
BlockEnd(SectionOffsetLine),
Def(Def),
Def2(Def2),
}Expand description
A section within an OBJ file.
Sections can contain code, data, relocations, symbols, or debug information. The section list is terminated by a NOP entry.
§Section Types
Variants§
NOP
Code(Code)
RunAtOffset(u16, u16)
SectionSwitch(u16)
BSS(u32)
Uninitialized data (BSS) with size in bytes.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x8 |
| 1 | u32 | Size in bytes |
Patch(Patch)
XDEF(XDEF)
External symbol definition.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0xC |
| 1 | XDEF | An XDEF structure. |
XREF(XREF)
External symbol reference.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0xE |
| 1 | XREF | An XREF structure. |
LNKHeader(LNKHeader)
Section header.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x10 |
| 1 | LNKHeader | An LNKHeader structure. |
LocalSymbol(LocalSymbol)
Local symbol.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x12 |
| 1 | LocalSymbol | A LocalSymbol structure |
GroupSymbol(GroupSymbol)
Group symbol.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x14 |
| 1 | GroupSymbol | A GroupSymbol structure. |
ByteSizeRegister(u16)
Untested
WordSizeRegister(u16)
Untested
LongSizeRegister(u16)
Untested
Filename(Filename)
File name reference.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x1C |
| 1 | Filename | A Filename structure. |
SetToFile(u16, u32)
Untested
SetToLine(u32)
Untested
IncrementLineNumber
Untested
IncrementLineNumberByte(u8)
Untested
IncrementLineNumberWord(u32)
Untested
VeryLocalSymbol(LocalSymbol)
Untested
Set3ByteRegister(u16)
Untested
SetMXInfo(SetMXInfo)
Set MX info.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x2C |
| 1 | SetMXInfo | A SetMXInfo structure. |
CPU(u8)
CPU type specification.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x2E |
| 1 | u8 | A CPU identifier. |
Constants for CPU identifiers can be found in the cputype module.
XBSS(XBSS)
IncSLDLineNum(u16)
Increment line number.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x32 |
| 1 | u16 | The offset where the new line number starts. |
See also: IncSLDLineNumByte, IncSLDLineNumWord
IncSLDLineNumByte(u16, u8)
Increment line number by an amount.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x34 |
| 1 | u16 | The offset where the new line number starts. |
| 3 | u8 | The amount to increment the line number. |
See also IncSLDLineNum, IncSLDLineNumWord
IncSLDLineNumWord(u16, u32)
Increment line number by an amount.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x34 |
| 1 | u16 | The offset where the new line number starts. |
| 3 | u8 | The amount to increment the line number. |
See also: IncSLDLineNum, IncSLDLineNumByte
SetSLDLineNum(SetSLDLineNum)
Set line number.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x38 |
| 1 | SetSLDLineNum | A SetSLDLineNum structure. |
See also: SetSLDLineNumFile
SetSLDLineNumFile(SetSLDLineNumFile)
Set line number with file name.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x3A |
| 1 | SetSLDLineNumFile | A SetSLDLineNumFile structure. |
See also: SetSLDLineNum
EndSLDInfo(u16)
End of SLD info.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x3C |
| 1 | u16 | Offset where SLD info ends. |
RepeatByte(u32)
Untested
RepeatWord(u32)
Untested
RepeatLong(u32)
Untested
ProcedureCall(ProcedureCall)
Untested
ProcedureDefinition(ProcedureDefinition)
Untested
Repeat3Byte(u32)
Untested
FunctionStart(FunctionStart)
Function start marker.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x4A |
| 1 | FunctionStart | A FunctionStart structure. |
FunctionEnd(SectionOffsetLine)
Function end marker.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x4C |
| 1 | SectionOffsetLine | A SectionOffsetLine structure. |
BlockStart(SectionOffsetLine)
Block start marker.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x4E |
| 1 | SectionOffsetLine | A SectionOffsetLine structure. |
BlockEnd(SectionOffsetLine)
Block end marker.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x50 |
| 1 | SectionOffsetLine | A SectionOffsetLine structure. |
Def(Def)
Variable/type definition.
§Structure on Disk
| Offset | Type | Description |
|---|---|---|
| 0 | u8 | Magic: 0x52 |
| 1 | Def | A Def structure. |
Def2(Def2)
Trait Implementations§
Source§impl BinRead for Section
impl BinRead for Section
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl BinWrite for Section
impl BinWrite for Section
Source§fn write_options<W: Write + Seek>(
&self,
__binrw_generated_var_writer: &mut W,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<()>
fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>
Source§fn write<W>(&self, writer: &mut W) -> Result<(), Error>
fn write<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer using default arguments. Read moreSource§fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming big-endian byte order. Read moreSource§fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming little-endian byte order. Read moreSource§fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
fn write_ne<W>(&self, writer: &mut W) -> Result<(), Error>
Self to the writer assuming native-endian byte order. Read moreSource§fn write_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer using the given arguments. Read moreSource§fn write_be_args<W>(
&self,
writer: &mut W,
args: Self::Args<'_>,
) -> Result<(), Error>
fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
Self to the writer, assuming big-endian byte order, using the
given arguments. Read moreSource§impl DisplayWithOptions for Section
impl DisplayWithOptions for Section
Source§impl ReadEndian for Section
impl ReadEndian for Section
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
Source§impl WriteEndian for Section
impl WriteEndian for Section
Source§const ENDIAN: EndianKind
const ENDIAN: EndianKind
impl StructuralPartialEq for Section
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnwindSafe for Section
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)