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