pub type Segments<'data> = Table<Segment<'data>>;
Expand description
A segment table.
Aliased Type§
struct Segments<'data>(/* private fields */);
Implementations§
source§impl<'data> Segments<'data>
impl<'data> Segments<'data>
sourcepub fn find_load_segment_from_offset(
&self,
offset: u64
) -> Option<&Segment<'data>>
pub fn find_load_segment_from_offset( &self, offset: u64 ) -> Option<&Segment<'data>>
Find a PT_LOAD
segment containing the given offset.
sourcepub fn add_load_segment(
&mut self,
flags: u32,
align: u64
) -> &mut Segment<'data>
pub fn add_load_segment( &mut self, flags: u32, align: u64 ) -> &mut Segment<'data>
Add a new PT_LOAD
segment to the table.
The file offset and address will be derived from the current maximum for any segment.
The address will be chosen so that p_paddr % align == p_offset % align
.
You may wish to use Builder::load_align
for the alignment.