jon.recoil.org

Module Arm64_binary_emitter.All_section_states

Collection of section states for all sections in an assembly unit.

module Asm_label = Asm_targets.Asm_label
module Asm_section = Asm_targets.Asm_section
module Asm_symbol = Asm_targets.Asm_symbol
module Symbol = Arm64_ast.Ast.Symbol
type t
val create : for_jit:bool -> t
val for_jit : t -> bool
val get_or_create : t -> Asm_section.t -> Section_state.t
val find : t -> Asm_section.t -> Section_state.t option
val find_exn : t -> Asm_section.t -> Section_state.t
val iter : t -> f:(Asm_section.t -> Section_state.t -> unit) -> unit
val fold : t -> init:'a -> f:(Asm_section.t -> Section_state.t -> 'a -> 'a) -> 'a

Individual sections: for sections tracked by their exact name string rather than the Asm_section.t enum. This is needed for function sections where each function gets its own .text.caml.<funcname> section. These sections are tracked separately so we can compare them individually against the assembler output during verification.

val get_or_create_individual : t -> string -> Section_state.t
val find_individual : t -> string -> Section_state.t option
val iter_individual : t -> f:(string -> Section_state.t -> unit) -> unit
val fold_individual : t -> init:'a -> f:(string -> Section_state.t -> 'a -> 'a) -> 'a
val find_in_any_individual_section : t -> Symbol.target -> (int * Asm_section.t) option
val find_in_any_individual_section_with_state : t -> Symbol.target -> (int * Asm_section.t * Section_state.t) option

Search individual sections for a label or symbol. Returns (offset, section, state) if found.

val find_in_any_section_with_state : t -> Symbol.target -> (int * Asm_section.t * Section_state.t) option

Search all sections for a label or symbol. Returns (offset, section, section_state) if found. This is needed when the caller needs to access the actual state where the label was found.

val find_in_any_section : t -> Symbol.target -> (int * Asm_section.t) option
val reset_offsets : t -> unit
val add_direct_assignment : t -> string -> D.Directive.Constant.t -> unit
val find_direct_assignment : t -> string -> D.Directive.Constant.t option