arch/arm64_symbolization

ARM64 architecture-specific rules for symbolization

split_load(ea:address, nextea:address, dest:address, type:symbol)

Compute an immediate load performed across two consecutive instructions

adrp_used(EA:address, Reg:register, UsedEA:address, Dest:address)

A reference to a page-aligned value loaded by an adr or adrp instruction.

EA: Address of the adr/adrp instruction Reg: The register that holds the used value UsedEA: Address where the value is used Dest: The destination address

We care primarily about adrp, but sometimes if the target is close enough, the assembler will substitute an adr to the page-aligned address instead.

Reg is not necessarily the register loaded by adrp! It may be the result of:

adrp x0, label mov x1, x0

UsedEA:

# x1 is used

and Reg would be x1

split_load_tail(EA:address, Offset:number, Reg:register, Type:symbol)

An instruction which could be the second half of a split load.

split_load_for_symbolization(ea:address, nextea:address, dest:address, type:symbol)

This version of split_load uses def_used, so this should not be used for the code inference step due to cyclic negation issue. Instead, this is for the symbolization step.

lo_reloc_index(RelocType:symbol, OpIndex:unsigned)

OpIndex: operand index for the corresponding relocation

movz_movk_insn(EA:address, Reg:register, Val:number, ShiftMask:unsigned, Operation:symbol)

Individual MOVZ or MOVK instruction with its 16-bit immediate and shift.

movz_movk_chain(EA_first:address, EA_last:address, Reg:register, Value:number, UsedShiftMask:unsigned, Count:unsigned)

A chain of MOVZ followed by one or more MOVKs to the same register. EA_first is always the MOVZ instruction. EA_last is the final instruction in the chain. Value is the accumulated 64-bit constant constructed from all instructions. UsedShiftMask tracks which 16-bit lanes have been written. Count is the number of instructions in the chain (1-4).

movz_movk_complete(EA_first:address, EA_last:address, Value:number)

The longest complete MOVZ+MOVK chain: a chain that cannot be extended further. This is the one we use for symbolization.

movz_movk_member(EA:address, EA_first:address, EA_last:address)

Helper: is EA part of a complete MOVZ+MOVK chain?

movz_movk_shift_group(ShiftMask:unsigned, Group:symbol)

Helper: map a shift amount to the corresponding group attribute name.