pub struct Reloc {
pub at: usize,
pub symbol: String,
pub kind: Reference,
pub addend: i64,
pub after: u8,
}Expand description
One reference to something this file does not contain.
Fields§
§at: usizeWhere the bytes the linker writes over begin.
symbol: StringWhat is wanted, as the C program spelled it.
kind: ReferenceWhat the linker is being asked for.
addend: i64What to add to the distance, which is the constant the instruction already meant plus the bytes between the hole and the end of the instruction, negated. An instruction counts from where it ends and a relocation counts from where it starts, and this is the difference.
after: u8How many bytes of the instruction come after the four the linker writes over, which is zero for everything except an instruction carrying an immediate behind its displacement.
Already inside Self::addend and written down again because the two formats disagree about
which of the two numbers they want. ELF takes the one number and counts from where the hole
starts, so the difference between that and where the instruction ends is the writer’s to fold
in and nothing after it ever has to be told apart again. COFF counts from where the
instruction ends and says how far that is in the relocation type itself, which is what
IMAGE_REL_AMD64_REL32_1 through REL32_5 are, so it needs the two apart. A writer cannot
recover one from the other, since a displacement of minus four and no trailing bytes and a
displacement of zero and four of them are the same sum.
Zero for a relocation in an image, where there is no instruction and the question does not arise.
Trait Implementations§
impl Eq for Reloc
impl StructuralPartialEq for Reloc
Auto Trait Implementations§
impl Freeze for Reloc
impl RefUnwindSafe for Reloc
impl Send for Reloc
impl Sync for Reloc
impl Unpin for Reloc
impl UnsafeUnpin for Reloc
impl UnwindSafe for Reloc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.