pub trait ObjectSection<'data>: Sealed {
    type RelocationIterator: Iterator<Item = (u64, Relocation)>;
Show 15 methods fn index(&self) -> SectionIndex;
fn address(&self) -> u64;
fn size(&self) -> u64;
fn align(&self) -> u64;
fn file_range(&self) -> Option<(u64, u64)>;
fn data(&self) -> Result<&'data [u8]>;
fn data_range(&self, address: u64, size: u64) -> Result<Option<&'data [u8]>>;
fn compressed_file_range(&self) -> Result<CompressedFileRange>;
fn compressed_data(&self) -> Result<CompressedData<'data>>;
fn name(&self) -> Result<&str>;
fn segment_name(&self) -> Result<Option<&str>>;
fn kind(&self) -> SectionKind;
fn relocations(&self) -> Self::RelocationIterator;
fn flags(&self) -> SectionFlags; fn uncompressed_data(&self) -> Result<Cow<'data, [u8]>> { ... }
}
Expand description

A section defined in an object file.

Associated Types

An iterator over the relocations for a section.

The first field in the item tuple is the section offset that the relocation applies to.

Required methods

Returns the section index.

Returns the address of the section.

Returns the size of the section in memory.

Returns the alignment of the section in memory.

Returns offset and size of on-disk segment (if any).

Returns the raw contents of the section.

The length of this data may be different from the size of the section in memory.

This does not do any decompression.

Return the raw contents of the section data in the given range.

This does not do any decompression.

Returns Ok(None) if the section does not contain the given range.

Returns the potentially compressed file range of the section, along with information about the compression.

Returns the potentially compressed contents of the section, along with information about the compression.

Returns the name of the section.

Returns the name of the segment for this section.

Return the kind of this section.

Get the relocations for this section.

Section flags that are specific to each file format.

Provided methods

Returns the uncompressed contents of the section.

The length of this data may be different from the size of the section in memory.

If no compression is detected, then returns the data unchanged. Returns Err if decompression fails.

Implementors