RelocationKind

Enum RelocationKind 

Source
pub enum RelocationKind {
Show 33 variants Absolute, AbsoluteSet, AbsoluteSetWord6, AbsoluteAddition, AbsoluteSubtraction, AbsoluteSubtractionWord6, AbsoluteAArch64, PairSubtraction, Relative, RelativeRiscVLow12, SymRelGotBase, GotRelGotBase, Got, PltRelGotBase, PltRelative, GotRelative, TlsGd, TlsGdGot, TlsGdGotBase, TlsLd, TlsLdGot, TlsLdGotBase, DtpOff, GotTpOff, GotTpOffGot, GotTpOffGotBase, TpOff, TlsDesc, TlsDescGot, TlsDescGotBase, TlsDescCall, None, Alignment,
}
Expand description

For additional information on ELF relocation types, see “ELF-64 Object File Format” - https://uclibc.org/docs/elf-64-gen.pdf. For information on the TLS related relocations, see “ELF Handling For Thread-Local Storage” - https://www.uclibc.org/docs/tls.pdf.

Variants§

§

Absolute

The absolute address of a symbol or section.

§

AbsoluteSet

The absolute address of a symbol or section related to EH section.

§

AbsoluteSetWord6

The 6 low bits of an absolute address of a symbol or section.

§

AbsoluteAddition

Add the absolute address of a symbol or section at the place of the relocation to the value at the place.

§

AbsoluteSubtraction

Subtract the absolute address of a symbol or section at the place of the relocation from the value at the place.

§

AbsoluteSubtractionWord6

Subtract the absolute address of a symbol or section at the place of the relocation from the value at the place (use WORD6 type for the operation)

§

AbsoluteAArch64

The absolute address of a symbol or section. We are going to extract only the offset within a page, so dynamic relocation creation must be skipped.

§

PairSubtraction

Subtract addresses of two symbols and encode the value using ULEB128.

§

Relative

The address of the symbol, relative to the place of the relocation.

§

RelativeRiscVLow12

The address of the symbol, relative to the place of the relocation. The address of the relocation points to an instruction for which the R_RISCV_PCREL_HI20 relocation is used and that is the place we make this relocation relative to.

§

SymRelGotBase

The address of the symbol, relative to the base address of the GOT.

§

GotRelGotBase

The offset of the symbol’s GOT entry, relative to the start of the GOT.

§

Got

The address of the symbol’s GOT entry.

§

PltRelGotBase

The address of the symbol’s PLT entry, relative to the base address of the GOT.

§

PltRelative

The address of the symbol’s PLT entry, relative to the place of relocation.

§

GotRelative

The address of the symbol’s GOT entry, relative to the place of the relocation.

§

TlsGd

The address of a TLSGD structure, relative to the place of the relocation. A TLSGD (thread-local storage general dynamic) structure is a pair of values containing a module ID and the offset within that module’s TLS storage.

§

TlsGdGot

The address of the symbol’s TLSGD GOT entry.

§

TlsGdGotBase

The address of the symbol’s TLSGD GOT entry, relative to the start of the GOT.

§

TlsLd

The address of the TLS module ID for the shared object that we’re writing, relative to the place of the relocation. This is used when a TLS variable is defined and used within the same shared object.

§

TlsLdGot

The address of the TLS module ID for the shared object that we’re writing.

§

TlsLdGotBase

The address of the TLS module ID for the shared object that we’re writing, relative to the start of the GOT.

§

DtpOff

The offset of a thread-local within the TLS storage of DSO that defines that thread-local.

§

GotTpOff

The address of a GOT entry containing the offset of a TLS variable within the executable’s TLS storage, relative to the place of the relocation.

§

GotTpOffGot

The address of a GOT entry containing the offset of a TLS variable within the executable’s TLS storage.

§

GotTpOffGotBase

The address of a GOT entry containing the offset of a TLS variable within the executable’s TLS storage, relative to the start of the GOT.

§

TpOff

The offset of a TLS variable within the executable’s TLS storage.

§

TlsDesc

The address of a TLS descriptor structure, relative to the place of the relocation.

§

TlsDescGot

The address of a TLS descriptor structure.

§

TlsDescGotBase

The address of a TLS descriptor structure, relative to the start of the GOT.

§

TlsDescCall

Call to the TLS descriptor trampoline. Used only as a placeholder for a linker relaxation opportunity.

§

None

No relocation needs to be applied. Produced when we eliminate a relocation due to an optimisation.

§

Alignment

The address must fulfill the alignment requirement.

Implementations§

Trait Implementations§

Source§

impl Clone for RelocationKind

Source§

fn clone(&self) -> RelocationKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RelocationKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RelocationKind

Source§

fn eq(&self, other: &RelocationKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for RelocationKind

Source§

impl Eq for RelocationKind

Source§

impl StructuralPartialEq for RelocationKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.