jon.recoil.org

Module Ast.Symbol

Symbol references and relocations.

Same_section_and_unit is for references that the assembler can resolve directly, such as PC-relative branches within a function. These use 19-bit signed offsets giving +/-1MB range.

Needs_reloc is for references requiring linker involvement:

type _ reloc_directive =
  1. | LOWER_TWELVE : [ `Twelve ] reloc_directive
  2. | GOT_PAGE : [ `Twenty_one ] reloc_directive
  3. | GOT_PAGE_OFF : [ `Twelve ] reloc_directive
  4. | GOT_LOWER_TWELVE : [ `Twelve ] reloc_directive
  5. | PAGE : [ `Twenty_one ] reloc_directive
  6. | PAGE_OFF : [ `Twelve ] reloc_directive
  7. | CALL26 : [ `Twenty_six ] reloc_directive
  8. | JUMP26 : [ `Twenty_six ] reloc_directive
type 'w same_unit_or_reloc =
  1. | Same_section_and_unit : [ `Nineteen ] same_unit_or_reloc
  2. | Needs_reloc : 'w reloc_directive -> 'w same_unit_or_reloc
type target =
  1. | Label of Asm_targets.Asm_label.t
  2. | Symbol of Asm_targets.Asm_symbol.t
type 'w t = private {
  1. target : target;
  2. offset : int;
  3. reloc : 'w same_unit_or_reloc;
}
val create_label : 'w same_unit_or_reloc -> ?offset:int -> Asm_targets.Asm_label.t -> 'w t
val create_symbol : 'w same_unit_or_reloc -> ?offset:int -> Asm_targets.Asm_symbol.t -> 'w t
val is_label : _ t -> bool

Returns true if the target is a label.

val print_target : Format.formatter -> target -> unit
val print : Format.formatter -> _ t -> unit