#[non_exhaustive]pub enum RelocationTarget {
Symbol(SymbolId),
Section(SectionId),
}Expand description
What a relocation’s address comes from.
§Examples
use object_lang::{Architecture, Object, RelocationTarget, Section, SectionKind};
let mut obj = Object::relocatable(Architecture::X86_64);
let rodata = obj.add_section(Section::new(".rodata", SectionKind::ReadOnlyData));
// An address inside .rodata, without a named symbol for it.
let target = RelocationTarget::Section(rodata);
assert_eq!(target, RelocationTarget::Section(rodata));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Symbol(SymbolId)
The address of a symbol of the object.
Section(SectionId)
The start address of a section of the object; the addend picks the place inside it. This is how compilers refer to unnamed data such as string literals.
Trait Implementations§
Source§impl Clone for RelocationTarget
impl Clone for RelocationTarget
impl Copy for RelocationTarget
Source§impl Debug for RelocationTarget
impl Debug for RelocationTarget
impl Eq for RelocationTarget
Source§impl Hash for RelocationTarget
impl Hash for RelocationTarget
Source§impl PartialEq for RelocationTarget
impl PartialEq for RelocationTarget
impl StructuralPartialEq for RelocationTarget
Auto Trait Implementations§
impl Freeze for RelocationTarget
impl RefUnwindSafe for RelocationTarget
impl Send for RelocationTarget
impl Sync for RelocationTarget
impl Unpin for RelocationTarget
impl UnsafeUnpin for RelocationTarget
impl UnwindSafe for RelocationTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more