Trait object::ObjectSection
source · pub trait ObjectSection<'data> {
type RelocationIterator: Iterator<Item = (u64, Relocation)>;
fn address(&self) -> u64;
fn size(&self) -> u64;
fn data(&self) -> Cow<'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;
}
Expand description
A section defined in an object file.
Required Associated Types§
sourcetype RelocationIterator: Iterator<Item = (u64, Relocation)>
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.
Required Methods§
sourcefn data(&self) -> Cow<'data, [u8]>
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.
sourcefn uncompressed_data(&self) -> Cow<'data, [u8]>
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.
sourcefn segment_name(&self) -> Option<&str>
fn segment_name(&self) -> Option<&str>
Returns the name of the segment for this section.
sourcefn kind(&self) -> SectionKind
fn kind(&self) -> SectionKind
Return the kind of this section.
sourcefn relocations(&self) -> Self::RelocationIterator
fn relocations(&self) -> Self::RelocationIterator
Get the relocations for this section.