Module For_jit.Relocation
type t = Relocation.tval offset_from_section_beginning : t -> intval size : t -> Binary_emitter_intf.data_sizeval target_symbol : t -> Binary_emitter_intf.targetval target_symbols : t -> Binary_emitter_intf.target listFor paired relocations (e.g., SUBTRACTOR + UNSIGNED), returns all symbols. For single relocations, returns a singleton list. Used for saving relocations to files for verification.
val target_symbols_with_addends : t -> (Binary_emitter_intf.target * int) listFor paired relocations, returns all symbols with their addends. On RELA platforms (Linux ELF), addends are stored in relocations. On REL platforms (macOS), addends are encoded in instructions.
val is_got_reloc : t -> boolIs this a GOT relocation? (JIT needs to know for GOT table building)
val is_plt_reloc : t -> boolIs this a PLT relocation? (JIT needs to know for PLT table building)
val compute_value :
t ->
place_address:int64 ->
lookup_target:(Binary_emitter_intf.target -> int64 option) ->
read_instruction:(unit -> int32) ->
(int64, string) resultCompute the value to patch given:
place_address: where the relocation site is in memorylookup_target: resolve symbol/label -> addressread_instruction: read the 32-bit instruction at the relocation site (used by ARM64 to read-modify-write instruction bit fields) Returns the value to write at the relocation site, or an error.