pub enum RelocKind {
ThmCall,
MovwAbs,
MovtAbs,
Abs32,
AArch64Call26,
AArch64Jump26,
AArch64AdrPrelPgHi21,
AArch64AddAbsLo12Nc,
RiscvCallPlt,
}Expand description
A relocation entry produced during compilation
Records that a BL instruction at offset bytes into the function’s code
targets an external symbol (e.g., __meld_dispatch_import). The linker
resolves these when combining the Synth object with the Kiln bridge.
Variants§
ThmCall
R_ARM_THM_CALL — a Thumb BL call site (the default; #167).
MovwAbs
R_ARM_MOVW_ABS_NC — the MOVW half of a symbol-relative address (#237).
MovtAbs
R_ARM_MOVT_ABS — the MOVT half of a symbol-relative address (#237).
Abs32
R_ARM_ABS32 — a 32-bit absolute address held in a .text literal-pool
word, loaded via LDR rX, [pc, #off] (#345). The link-survivable
replacement for the inline-immediate MOVW/MOVT-ABS pair: ld/bfd patches
the data word at link time (S + A, the addend living in the word, REL
semantics), which survives placement into a large multi-object image —
whereas an inline-instruction MOVW_ABS immediate can be mangled.
AArch64Call26
R_AARCH64_CALL26 (ELF type 283) — an AArch64 BL call site (#851). The
AArch64 analogue of RelocKind::ThmCall: the linker patches the 26-bit
word-offset immediate of the bl at offset to reach the target symbol.
Emitted only by the EM_AARCH64 backend’s .rela.text.
AArch64Jump26
R_AARCH64_JUMP26 (ELF type 282) — an AArch64 B (tail-branch) site
(#851 lane L3). Same 26-bit word-offset immediate as
RelocKind::AArch64Call26, but for a branch that does NOT set x30:
the aarch64 call_indirect funcref table is a .text-resident array of
b func_N trampolines, so the dispatch’s blr sets the return address
and the trampoline tail-branches into the callee (which returns straight
to the dispatcher).
AArch64AdrPrelPgHi21
R_AARCH64_ADR_PREL_PG_HI21 (ELF type 275) — the adrp half of a
PC-relative symbol address (#851 lane L3). Patches the 21-bit page delta
(immlo[30:29] + immhi[23:5]) so adrp xd, sym reaches the 4 KiB page
containing sym. Always paired with an
RelocKind::AArch64AddAbsLo12Nc on the next instruction. This pair is
how aarch64 reaches a synth-EMITTED region (the globals .data image,
the funcref table) with NO dedicated base register — so neither feature
adds an embedder precondition alongside x28.
AArch64AddAbsLo12Nc
R_AARCH64_ADD_ABS_LO12_NC (ELF type 277) — the add xd, xd, :lo12:sym
half of a PC-relative symbol address (#851 lane L3). Patches the 12-bit
immediate field [21:10] with (S + A) & 0xFFF.
RiscvCallPlt
R_RISCV_CALL_PLT (ELF type 19) — a RISC-V auipc+jalr call pair
(#871). The RV32 analogue of RelocKind::ThmCall: offset points at
the auipc of an 8-byte auipc ra, 0 ; jalr ra, 0(ra) placeholder and
the linker patches BOTH instructions’ immediates to reach the target
symbol (the modern form; R_RISCV_CALL is deprecated). Emitted only by
the EM_RISCV backend’s .rela.text.
Trait Implementations§
impl Copy for RelocKind
impl Eq for RelocKind
impl StructuralPartialEq for RelocKind
Auto Trait Implementations§
impl Freeze for RelocKind
impl RefUnwindSafe for RelocKind
impl Send for RelocKind
impl Sync for RelocKind
impl Unpin for RelocKind
impl UnsafeUnpin for RelocKind
impl UnwindSafe for RelocKind
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.