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
Uses:
arch.load_operation,arch.store_operation,instruction,instruction_get_dest_op,instruction_get_op,next,op_immediate,op_indirect_mapped,op_regdirect_contains_reg,symbolUsed by:
__agg_subclause8,base_addr_offset_operand_candidate,symbol_minus_symbol,symbolic_operand_attribute,symbolic_operand_mips_candidateRecursive:
stack_def_use.live_var_at_block_end,value_reg,stack_def_use.ref_in_block,discarded_block,fallthrough_over_padding,arm_jump_table_candidate_start,no_return_call_refined,reg_def_use.live_var_at_prior_used,init_ldr_add_pc,relocation_adjustment,arm_jump_table_candidate,data_block_limit,cmp_defines,__agg_subclause6,after_end,block_last_instruction,adjusts_stack_in_block,base_relative_operation,must_fallthrough,arch.reg_relative_load,stack_def_use.block_last_def,reg_used_for,local_dynamic_tls_candidate,value_reg_unsupported,branch_to_calculated_pc_rel_addr,const_value_reg_used,symbolic_expr_from_relocation,common_tail,reg_def_use.ambiguous_last_def_in_block,reg_def_use.def_used,value_reg_edge,wis_schedule,correlated_live_reg,arm_jump_table_skip_first_entry,symbol_minus_symbol_litpool_access_pattern,wis_memo,reg_def_use.live_var_used,__agg_single6,reg_reg_arithmetic_operation_defs,call_tls_get_addr,unresolved_interval,data_in_code_propagate,reg_def_use.flow_def,block_total_points,stack_def_use.live_var_at_prior_used,block_candidate_boundaries,stack_def_use.last_def_in_block,reg_has_base_image,instruction_memory_access_size,tls_get_addr,inferred_main_dispatch,wis_prior,tls_relative_operand_mips,__agg_single10,composite_data_access_candidate,candidate_block_is_not_padding,jump_table_candidate_refined,first_block_in_byte_interval,indexed_pc_relative_load_relative,got_relative_operand,__agg_subclause3,next_type,candidate_block_is_padding,litpool_confidence,reg_def_use.block_last_def,segment_target_range,incomplete_block,reg_def_use.live_var_at_block_end,litpool_ref,jump_table_element_access,stack_def_use.used_in_block,arch.extend_load,__agg_subclause2,contains_plausible_instr_seq,arm_jump_table_cmp_limit,block_limit,nop_in_padding_candidate,reg_def_use.live_var_def,stack_base_reg_move,no_value_reg_limit,possible_target_from,relative_address,arm_jump_table_block_instruction,block_instruction_next,value_reg_limit,padding_block_limit,resolved_reaches,code_in_block_candidate_refined,__agg_single3,jump_table_max,block_next,straight_line_last_def,indefinite_litpool_ref,call_may_fallthrough_inter,invalid_jump_table_candidate,split_load_conflict,stack_def_use.def_used,block_points_proportional,data_block_candidate,arm_jump_table_data_block,compare_and_jump_register,litpool_symbolic_operand,split_load_for_symbolization,data_segment,contains_implausible_instr_seq,next_start,inferred_main_in_reg,block,split_load_point,call_tls_get_addr_mips,indexed_pc_relative_load,compare_and_jump_indirect_op_valid,jump_table_signed,split_load_operand,start_function,reg_def_use.defined_in_block,flags_and_jump_pair,reg_def_use.used_in_block,basic_target,overlap_with_litpool,__agg_subclause4,jump_table_target,next_end,jump_table_prelude,overlapping_instruction,base_relative_operand,relocation_adjustment_total,impossible_block,inter_procedural_edge,init_symbol_minus_symbol_candidate_arm,call_target_has_other_fallthrough_inter,gp_relative_operand,stack_def_use.live_var_used,jump_table_start,block_candidate_dependency_edge,unresolved_block,no_return_call_propagated,self_contained_segment,reg_def_use.ref_in_block,reg_def_use.ambiguous_block_last_def,reg_def_use.return_block_end,block_points,no_return_call,unresolved_block_overlap,def_used_for_address,invalid,cmp_reg_to_reg,unresolved_interval_order,code_in_block_candidate,next_function_entry_initial,block_boundaries,initial_function_containing_return,compare_and_jump_immediate,simple_data_access_pattern,unlikely_have_symbolic_immediate,straight_line_def_used,block_heuristic,stack_def_use.live_var_def,known_block,__agg_subclause7,base_relative_jump,code_in_block,reg_def_use.used,cinf_ldr_add_pc,plt_block,relative_address_start,likely_fallthrough,discarded_split_load,split_load_total_points,arch.simple_data_load,__agg_single2,litpool_boundaries,transition_block_limit,last_value_reg_limit,negative_block_heuristic,block_implies_block,relative_jump_table_entry_candidate,adrp_used,initialized_data_segment,is_padding,compare_and_jump_indirect,jump_table_candidate,block_overlap,split_load_candidate,wis_has_prior,tls_desc_call,reg_has_got,arm_jump_table_block_start,reg_def_use.return_val_used,reg_def_use.last_def_in_block,arm_jump_table_data_block_limit,next_block_in_byte_interval,stack_def_use.defined_in_block,may_fallthrough,data_in_code,data_access,wis_schedule_iter,stack_def_use.live_var_used_in_block,plt_entry,hi_load_prop,no_return_block,possible_target,split_load,padding_block_candidate,function_inference.function_entry_initial
- 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
x1Uses:
arch.adr_dest,instructionRecursive:
stack_def_use.live_var_at_block_end,value_reg,stack_def_use.ref_in_block,discarded_block,fallthrough_over_padding,arm_jump_table_candidate_start,no_return_call_refined,reg_def_use.live_var_at_prior_used,init_ldr_add_pc,relocation_adjustment,arm_jump_table_candidate,data_block_limit,cmp_defines,__agg_subclause6,after_end,block_last_instruction,adjusts_stack_in_block,base_relative_operation,must_fallthrough,arch.reg_relative_load,stack_def_use.block_last_def,reg_used_for,local_dynamic_tls_candidate,value_reg_unsupported,branch_to_calculated_pc_rel_addr,const_value_reg_used,symbolic_expr_from_relocation,common_tail,reg_def_use.ambiguous_last_def_in_block,reg_def_use.def_used,value_reg_edge,wis_schedule,correlated_live_reg,arm_jump_table_skip_first_entry,symbol_minus_symbol_litpool_access_pattern,wis_memo,reg_def_use.live_var_used,__agg_single6,reg_reg_arithmetic_operation_defs,call_tls_get_addr,unresolved_interval,data_in_code_propagate,reg_def_use.flow_def,block_total_points,stack_def_use.live_var_at_prior_used,block_candidate_boundaries,stack_def_use.last_def_in_block,reg_has_base_image,instruction_memory_access_size,tls_get_addr,inferred_main_dispatch,wis_prior,tls_relative_operand_mips,__agg_single10,composite_data_access_candidate,candidate_block_is_not_padding,jump_table_candidate_refined,first_block_in_byte_interval,indexed_pc_relative_load_relative,got_relative_operand,__agg_subclause3,next_type,candidate_block_is_padding,litpool_confidence,reg_def_use.block_last_def,segment_target_range,incomplete_block,reg_def_use.live_var_at_block_end,litpool_ref,jump_table_element_access,stack_def_use.used_in_block,arch.extend_load,__agg_subclause2,contains_plausible_instr_seq,arm_jump_table_cmp_limit,block_limit,nop_in_padding_candidate,reg_def_use.live_var_def,stack_base_reg_move,no_value_reg_limit,possible_target_from,relative_address,arm_jump_table_block_instruction,block_instruction_next,value_reg_limit,padding_block_limit,resolved_reaches,code_in_block_candidate_refined,__agg_single3,jump_table_max,block_next,straight_line_last_def,indefinite_litpool_ref,call_may_fallthrough_inter,invalid_jump_table_candidate,split_load_conflict,stack_def_use.def_used,block_points_proportional,data_block_candidate,arm_jump_table_data_block,compare_and_jump_register,litpool_symbolic_operand,split_load_for_symbolization,data_segment,contains_implausible_instr_seq,next_start,inferred_main_in_reg,block,split_load_point,call_tls_get_addr_mips,indexed_pc_relative_load,compare_and_jump_indirect_op_valid,jump_table_signed,split_load_operand,start_function,reg_def_use.defined_in_block,flags_and_jump_pair,reg_def_use.used_in_block,basic_target,overlap_with_litpool,__agg_subclause4,jump_table_target,next_end,jump_table_prelude,overlapping_instruction,base_relative_operand,relocation_adjustment_total,impossible_block,inter_procedural_edge,init_symbol_minus_symbol_candidate_arm,call_target_has_other_fallthrough_inter,gp_relative_operand,stack_def_use.live_var_used,jump_table_start,block_candidate_dependency_edge,unresolved_block,no_return_call_propagated,self_contained_segment,reg_def_use.ref_in_block,reg_def_use.ambiguous_block_last_def,reg_def_use.return_block_end,block_points,no_return_call,unresolved_block_overlap,def_used_for_address,invalid,cmp_reg_to_reg,unresolved_interval_order,code_in_block_candidate,next_function_entry_initial,block_boundaries,initial_function_containing_return,compare_and_jump_immediate,simple_data_access_pattern,unlikely_have_symbolic_immediate,straight_line_def_used,block_heuristic,stack_def_use.live_var_def,known_block,__agg_subclause7,base_relative_jump,code_in_block,reg_def_use.used,cinf_ldr_add_pc,plt_block,relative_address_start,likely_fallthrough,discarded_split_load,split_load_total_points,arch.simple_data_load,__agg_single2,litpool_boundaries,transition_block_limit,last_value_reg_limit,negative_block_heuristic,block_implies_block,relative_jump_table_entry_candidate,adrp_used,initialized_data_segment,is_padding,compare_and_jump_indirect,jump_table_candidate,block_overlap,split_load_candidate,wis_has_prior,tls_desc_call,reg_has_got,arm_jump_table_block_start,reg_def_use.return_val_used,reg_def_use.last_def_in_block,arm_jump_table_data_block_limit,next_block_in_byte_interval,stack_def_use.defined_in_block,may_fallthrough,data_in_code,data_access,wis_schedule_iter,stack_def_use.live_var_used_in_block,plt_entry,hi_load_prop,no_return_block,possible_target,split_load,padding_block_candidate,function_inference.function_entry_initial
- 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.
Uses:
split_load_tailUsed by:
symbolic_operand_attributeRecursive:
stack_def_use.live_var_at_block_end,value_reg,stack_def_use.ref_in_block,discarded_block,fallthrough_over_padding,arm_jump_table_candidate_start,no_return_call_refined,reg_def_use.live_var_at_prior_used,init_ldr_add_pc,relocation_adjustment,arm_jump_table_candidate,data_block_limit,cmp_defines,__agg_subclause6,after_end,block_last_instruction,adjusts_stack_in_block,base_relative_operation,must_fallthrough,arch.reg_relative_load,stack_def_use.block_last_def,reg_used_for,local_dynamic_tls_candidate,value_reg_unsupported,branch_to_calculated_pc_rel_addr,const_value_reg_used,symbolic_expr_from_relocation,common_tail,reg_def_use.ambiguous_last_def_in_block,reg_def_use.def_used,value_reg_edge,wis_schedule,correlated_live_reg,arm_jump_table_skip_first_entry,symbol_minus_symbol_litpool_access_pattern,wis_memo,reg_def_use.live_var_used,__agg_single6,reg_reg_arithmetic_operation_defs,call_tls_get_addr,unresolved_interval,data_in_code_propagate,reg_def_use.flow_def,block_total_points,stack_def_use.live_var_at_prior_used,block_candidate_boundaries,stack_def_use.last_def_in_block,reg_has_base_image,instruction_memory_access_size,tls_get_addr,inferred_main_dispatch,wis_prior,tls_relative_operand_mips,__agg_single10,composite_data_access_candidate,candidate_block_is_not_padding,jump_table_candidate_refined,first_block_in_byte_interval,indexed_pc_relative_load_relative,got_relative_operand,__agg_subclause3,next_type,candidate_block_is_padding,litpool_confidence,reg_def_use.block_last_def,segment_target_range,incomplete_block,reg_def_use.live_var_at_block_end,litpool_ref,jump_table_element_access,stack_def_use.used_in_block,arch.extend_load,__agg_subclause2,contains_plausible_instr_seq,arm_jump_table_cmp_limit,block_limit,nop_in_padding_candidate,reg_def_use.live_var_def,stack_base_reg_move,no_value_reg_limit,possible_target_from,relative_address,arm_jump_table_block_instruction,block_instruction_next,value_reg_limit,padding_block_limit,resolved_reaches,code_in_block_candidate_refined,__agg_single3,jump_table_max,block_next,straight_line_last_def,indefinite_litpool_ref,call_may_fallthrough_inter,invalid_jump_table_candidate,split_load_conflict,stack_def_use.def_used,block_points_proportional,data_block_candidate,arm_jump_table_data_block,compare_and_jump_register,litpool_symbolic_operand,split_load_for_symbolization,data_segment,contains_implausible_instr_seq,next_start,inferred_main_in_reg,block,split_load_point,call_tls_get_addr_mips,indexed_pc_relative_load,compare_and_jump_indirect_op_valid,jump_table_signed,split_load_operand,start_function,reg_def_use.defined_in_block,flags_and_jump_pair,reg_def_use.used_in_block,basic_target,overlap_with_litpool,__agg_subclause4,jump_table_target,next_end,jump_table_prelude,overlapping_instruction,base_relative_operand,relocation_adjustment_total,impossible_block,inter_procedural_edge,init_symbol_minus_symbol_candidate_arm,call_target_has_other_fallthrough_inter,gp_relative_operand,stack_def_use.live_var_used,jump_table_start,block_candidate_dependency_edge,unresolved_block,no_return_call_propagated,self_contained_segment,reg_def_use.ref_in_block,reg_def_use.ambiguous_block_last_def,reg_def_use.return_block_end,block_points,no_return_call,unresolved_block_overlap,def_used_for_address,invalid,cmp_reg_to_reg,unresolved_interval_order,code_in_block_candidate,next_function_entry_initial,block_boundaries,initial_function_containing_return,compare_and_jump_immediate,simple_data_access_pattern,unlikely_have_symbolic_immediate,straight_line_def_used,block_heuristic,stack_def_use.live_var_def,known_block,__agg_subclause7,base_relative_jump,code_in_block,reg_def_use.used,cinf_ldr_add_pc,plt_block,relative_address_start,likely_fallthrough,discarded_split_load,split_load_total_points,arch.simple_data_load,__agg_single2,litpool_boundaries,transition_block_limit,last_value_reg_limit,negative_block_heuristic,block_implies_block,relative_jump_table_entry_candidate,adrp_used,initialized_data_segment,is_padding,compare_and_jump_indirect,jump_table_candidate,block_overlap,split_load_candidate,wis_has_prior,tls_desc_call,reg_has_got,arm_jump_table_block_start,reg_def_use.return_val_used,reg_def_use.last_def_in_block,arm_jump_table_data_block_limit,next_block_in_byte_interval,stack_def_use.defined_in_block,may_fallthrough,data_in_code,data_access,wis_schedule_iter,stack_def_use.live_var_used_in_block,plt_entry,hi_load_prop,no_return_block,possible_target,split_load,padding_block_candidate,function_inference.function_entry_initial
- 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).
Uses:
movz_movk_insn,nextUsed by:
movz_movk_complete,movz_movk_memberRecursive:
movz_movk_chain
- 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.