[][src]Trait object::ObjectSection

pub trait ObjectSection<'data> {
    type RelocationIterator: Iterator<Item = (u64, Relocation)>;
    fn index(&self) -> SectionIndex;
fn address(&self) -> u64;
fn size(&self) -> u64;
fn align(&self) -> u64;
fn data(&self) -> Cow<'data, [u8]>;
fn data_range(&self, address: u64, size: u64) -> Option<&'data [u8]>;
fn uncompressed_data(&self) -> Cow<'data, [u8]>;
fn name(&self) -> Option<&str>;
fn segment_name(&self) -> Option<&str>;
fn kind(&self) -> SectionKind;
fn relocations(&self) -> Self::RelocationIterator; }

A section defined in an object file.

Associated Types

type RelocationIterator: Iterator<Item = (u64, Relocation)>

An iterator over the relocations for a section.

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

Loading content...

Required methods

fn index(&self) -> SectionIndex

Returns the section index.

fn address(&self) -> u64

Returns the address of the section.

fn size(&self) -> u64

Returns the size of the section in memory.

fn align(&self) -> u64

Returns the alignment of the section in memory.

fn data(&self) -> Cow<'data, [u8]>

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.

fn data_range(&self, address: u64, size: u64) -> Option<&'data [u8]>

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

This does not do any decompression.

fn uncompressed_data(&self) -> Cow<'data, [u8]>

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

fn name(&self) -> Option<&str>

Returns the name of the section.

fn segment_name(&self) -> Option<&str>

Returns the name of the segment for this section.

fn kind(&self) -> SectionKind

Return the kind of this section.

fn relocations(&self) -> Self::RelocationIterator

Get the relocations for this section.

Loading content...

Implementors

impl<'data, 'file> ObjectSection<'data> for ElfSection<'data, 'file>[src]

type RelocationIterator = ElfRelocationIterator<'data, 'file>

impl<'data, 'file> ObjectSection<'data> for MachOSection<'data, 'file>[src]

type RelocationIterator = MachORelocationIterator<'data, 'file>

impl<'data, 'file> ObjectSection<'data> for PeSection<'data, 'file>[src]

type RelocationIterator = PeRelocationIterator

impl<'data, 'file> ObjectSection<'data> for Section<'data, 'file>[src]

type RelocationIterator = RelocationIterator<'data, 'file>

impl<'file> ObjectSection<'static> for WasmSection<'file>[src]

type RelocationIterator = WasmRelocationIterator

Loading content...