pub struct RelocationMap(/* private fields */);
Expand description
A map from section offsets to relocation information.
This can be used to apply relocations to a value at a given section offset. This is intended for use with DWARF in relocatable object files, and only supports relocations that are used in DWARF.
Returned by ObjectSection::relocation_map
.
Implementations§
Source§impl RelocationMap
impl RelocationMap
Sourcepub fn new<'data, 'file, T>(
file: &'file T,
section: &T::Section<'file>,
) -> Result<Self>where
T: Object<'data>,
pub fn new<'data, 'file, T>(
file: &'file T,
section: &T::Section<'file>,
) -> Result<Self>where
T: Object<'data>,
Construct a new relocation map for a section.
Fails if any relocation cannot be added to the map.
You can manually use add
if you need different error handling,
such as to list all errors or to ignore them.
Sourcepub fn add<'data: 'file, 'file, T>(
&mut self,
file: &'file T,
offset: u64,
relocation: Relocation,
) -> Result<()>where
T: Object<'data>,
pub fn add<'data: 'file, 'file, T>(
&mut self,
file: &'file T,
offset: u64,
relocation: Relocation,
) -> Result<()>where
T: Object<'data>,
Add a single relocation to the map.
Trait Implementations§
Source§impl Debug for RelocationMap
impl Debug for RelocationMap
Source§impl Default for RelocationMap
impl Default for RelocationMap
Source§fn default() -> RelocationMap
fn default() -> RelocationMap
Returns the “default value” for a type. Read more