<s> static inline struct bpf_sock * bpf_get_listener_sock ( struct bpf_sock * sk ) {

return ( struct bpf_sock * ) __builtin_bpf_helper_get_listener_sock ( ( void * ) sk ) ;


<s> static inline struct bpf_sock * bpf_sk_fullsock ( struct bpf_sock * sk ) { return ( struct bpf_sock * ) __builtin_bpf_helper_sk_fullsock ( ( void * ) sk ) ;


<s> static inline struct bpf_sock * bpf_sk_lookup_tcp ( void * ctx , struct bpf_sock_tuple * tuple , int size , unsigned long long netns_id , unsigned long long flags ) {

return ( struct bpf_sock * ) __builtin_bpf_helper_sk_lookup_tcp ( ctx , ( void * ) tuple , size , netns_id , flags ) ;


<s> return ( struct bpf_sock * ) __builtin_bpf_helper_sk_lookup_tcp ( ctx , ( void * ) tuple , size , netns_id , flags ) ;


<s> return ( struct bpf_sock * ) __builtin_bpf_helper_sk_lookup_udp ( ctx , ( void * ) tuple , size , netns_id , flags ) ;


<s> static inline struct bpf_sock * bpf_sk_lookup_udp ( void * ctx , struct bpf_sock_tuple * tuple , int size , unsigned long long netns_id , unsigned long long flags ) {

return ( struct bpf_sock * ) __builtin_bpf_helper_sk_lookup_udp ( ctx , ( void * ) tuple , size , netns_id , flags ) ;


<s> static inline struct bpf_sock * bpf_tcp_sock ( struct bpf_sock * sk ) {

return ( struct bpf_sock * ) __builtin_bpf_helper_tcp_sock ( ( void * ) sk ) ;


<s> static inline long long load_byte ( void * skb __attribute__ ( ( unused ) ) , unsigned long long off ) { return __builtin_bpf_load_byte ( off ) ;


<s> static inline long long load_word ( void * skb __attribute__ ( ( unused ) ) , unsigned long long off ) { return __builtin_bpf_load_word ( off ) ;


<s> static inline long long load_word ( void * skb __attribute__ ( ( unused ) ) , unsigned long long off ) {

return __builtin_bpf_load_word ( off ) ;


<s> unsigned int end_bitpos = start_bitpos + align ; switch ( kind ) { case BPF_RELO_FIELD_BYTE_OFFSET : { if ( var_off != NULL_TREE ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( bitfieldp ) result = start_bitpos / <NUM_LIT> ; else result = bitpos / <NUM_LIT> ; } break ; case BPF_RELO_FIELD_BYTE_SIZE : { if ( mode == BLKmode && bitsize == - <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( bitfieldp ) { result = end_bitpos - start_bitpos ; if ( result & ( result - <NUM_LIT> ) ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } result = result / <NUM_LIT> ; } else result = bitsize / <NUM_LIT> ; } break ; case BPF_RELO_FIELD_EXISTS : result = <NUM_LIT> ; break ; case BPF_RELO_FIELD_SIGNED : result = ! unsignedp ; break ; case BPF_RELO_FIELD_LSHIFT_U64 : case BPF_RELO_FIELD_RSHIFT_U64 : { if ( mode == BLKmode && bitsize == - <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( var_off != NULL_TREE ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( ! bitfieldp ) { if ( bitsize > <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } result = <NUM_LIT> - bitsize ; break ; } if ( end_bitpos - start_bitpos > <NUM_LIT> ) {


<s> } unsigned int start_bitpos = bitpos & ~ ( align - <NUM_LIT> ) ; unsigned int end_bitpos = start_bitpos + align ; switch ( kind ) { case BPF_RELO_FIELD_BYTE_OFFSET : { if ( var_off != NULL_TREE ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( bitfieldp ) result = start_bitpos / <NUM_LIT> ; else result = bitpos / <NUM_LIT> ; } break ; case BPF_RELO_FIELD_BYTE_SIZE : { if ( mode == BLKmode && bitsize == - <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( bitfieldp ) { result = end_bitpos - start_bitpos ; if ( result & ( result - <NUM_LIT> ) ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } result = result / <NUM_LIT> ; } else result = bitsize / <NUM_LIT> ; } break ; case BPF_RELO_FIELD_EXISTS : result = <NUM_LIT> ; break ; case BPF_RELO_FIELD_SIGNED : result = ! unsignedp ; break ; case BPF_RELO_FIELD_LSHIFT_U64 : case BPF_RELO_FIELD_RSHIFT_U64 : { if ( mode == BLKmode && bitsize == - <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( var_off != NULL_TREE ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( ! bitfieldp ) { if ( bitsize > <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } result = <NUM_LIT> - bitsize ; break ; } if ( end_bitpos - start_bitpos > <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } if ( kind == BPF_RELO_FIELD_LSHIFT_U64 ) { if ( TARGET_BIG_ENDIAN ) result = bitpos + <NUM_LIT> - start_bitpos - align ; else result = start_bitpos + <NUM_LIT> - bitpos - bitsize ; } else result = <NUM_LIT> - bitsize ; } break ; default : error ( <STR_LIT> ) ;


<s> return bpf_core_is_maybe_aggregate_access ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; default : return false ; }


<s> case BPF_BUILTIN_PRESERVE_FIELD_INFO : { rettype = build_function_type_list ( unsigned_type_node , type , unsigned_type_node , NULL ) ; int len = snprintf ( name , sizeof ( name ) , <STR_LIT> , <STR_LIT> ) ; len = snprintf ( name + len , sizeof ( name ) - len , <STR_LIT> , pfi_count ++ ) ;


<s> static tree bpf_core_walk ( tree * tp , int * walk_subtrees , void * data ) { struct core_walk_data * dat = ( struct core_walk_data * ) data ; if ( TYPE_P ( * tp ) ) { * walk_subtrees = <NUM_LIT> ; return NULL_TREE ; } tree newdecl = bpf_core_newdecl ( TREE_TYPE ( * tp ) , dat -> which ) ; if ( dat -> which == BPF_BUILTIN_PRESERVE_ACCESS_INDEX ) { if ( bpf_core_is_maybe_aggregate_access ( * tp ) ) { * tp = build_call_expr_loc ( dat -> loc , newdecl , <NUM_LIT> , * tp ) ; * walk_subtrees = <NUM_LIT> ;


<s> if ( code == BPF_BUILTIN_LOAD_BYTE || code == BPF_BUILTIN_LOAD_HALF || code == BPF_BUILTIN_LOAD_WORD ) { enum insn_code abs_icode = ( code == BPF_BUILTIN_LOAD_BYTE ? CODE_FOR_ldabsb : code == BPF_BUILTIN_LOAD_HALF ? CODE_FOR_ldabsh : CODE_FOR_ldabsw ) ; enum insn_code ind_icode = ( code == BPF_BUILTIN_LOAD_BYTE ? CODE_FOR_ldindb : code == BPF_BUILTIN_LOAD_HALF ? CODE_FOR_ldindh : CODE_FOR_ldindw ) ; tree offset_arg = CALL_EXPR_ARG ( exp , <NUM_LIT> ) ; struct expand_operand ops [ <NUM_LIT> ] ; create_input_operand ( & ops [ <NUM_LIT> ] , expand_normal ( offset_arg ) , TYPE_MODE ( TREE_TYPE ( offset_arg ) ) ) ; create_input_operand ( & ops [ <NUM_LIT> ] , const0_rtx , SImode ) ; if ( ! maybe_expand_insn ( abs_icode , <NUM_LIT> , ops ) && ! maybe_expand_insn ( ind_icode , <NUM_LIT> , ops ) ) { error ( <STR_LIT> ) ; return gen_rtx_REG ( ops [ <NUM_LIT> ] . mode , BPF_R0 ) ; } return gen_rtx_REG ( ops [ <NUM_LIT> ] . mode , BPF_R0 ) ; } else if ( code == - BPF_BUILTIN_PRESERVE_ACCESS_INDEX ) {

tree arg = CALL_EXPR_ARG ( exp , <NUM_LIT> ) ;


<s> enum insn_code ind_icode = ( code == BPF_BUILTIN_LOAD_BYTE ? CODE_FOR_ldindb : code == BPF_BUILTIN_LOAD_HALF ? CODE_FOR_ldindh : CODE_FOR_ldindw ) ; tree offset_arg = CALL_EXPR_ARG ( exp , <NUM_LIT> ) ; struct expand_operand ops [ <NUM_LIT> ] ; create_input_operand ( & ops [ <NUM_LIT> ] , expand_normal ( offset_arg ) , TYPE_MODE ( TREE_TYPE ( offset_arg ) ) ) ; create_input_operand ( & ops [ <NUM_LIT> ] , const0_rtx , SImode ) ; if ( ! maybe_expand_insn ( abs_icode , <NUM_LIT> , ops ) && ! maybe_expand_insn ( ind_icode , <NUM_LIT> , ops ) ) { error ( <STR_LIT> ) ; return gen_rtx_REG ( ops [ <NUM_LIT> ] . mode , BPF_R0 ) ; } return gen_rtx_REG ( ops [ <NUM_LIT> ] . mode , BPF_R0 ) ; } else if ( code == - BPF_BUILTIN_PRESERVE_ACCESS_INDEX ) { tree arg = CALL_EXPR_ARG ( exp , <NUM_LIT> ) ; if ( arg == NULL_TREE ) return NULL_RTX ; if ( TREE_CODE ( arg ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( arg ) ;

if ( is_gimple_assign ( def_stmt ) ) arg = gimple_assign_rhs1 ( def_stmt ) ;


<s> if ( ! IN_RANGE ( fp_offset , - <NUM_LIT> - <NUM_LIT> , <NUM_LIT> ) ) break ; else { mem = gen_frame_mem ( DImode , plus_constant ( DImode , hard_frame_pointer_rtx , fp_offset - <NUM_LIT> ) ) ; emit_move_insn ( gen_rtx_REG ( DImode , regno ) , mem ) ; fp_offset -= <NUM_LIT> ; } } } }


<s> HOST_WIDE_INT size ; size = ( cfun -> machine -> local_vars_size + cfun -> machine -> callee_saved_reg_size ) ; if ( TARGET_XBPF ) { int regno ; int fp_offset = - cfun -> machine -> local_vars_size ; for ( regno = <NUM_LIT> ; regno < FIRST_PSEUDO_REGISTER ; regno ++ ) { if ( ( df_regs_ever_live_p ( regno ) && ! call_used_or_fixed_reg_p ( regno ) ) || ( cfun -> calls_alloca && regno == STACK_POINTER_REGNUM ) ) { rtx mem ; if ( ! IN_RANGE ( fp_offset , - <NUM_LIT> - <NUM_LIT> , <NUM_LIT> ) ) break ; else { mem = gen_frame_mem ( DImode , plus_constant ( DImode , hard_frame_pointer_rtx , fp_offset - <NUM_LIT> ) ) ; emit_move_insn ( mem , gen_rtx_REG ( DImode , regno ) ) ; fp_offset -= <NUM_LIT> ;


<s> static void bpf_init_builtins ( void ) { tree ullt = long_long_unsigned_type_node ; def_builtin ( <STR_LIT> , BPF_BUILTIN_LOAD_BYTE , build_function_type_list ( ullt , ullt , <NUM_LIT> ) ) ; def_builtin ( <STR_LIT> , BPF_BUILTIN_LOAD_HALF , build_function_type_list ( ullt , ullt , <NUM_LIT> ) ) ; def_builtin ( <STR_LIT> , BPF_BUILTIN_LOAD_WORD , build_function_type_list ( ullt , ullt , <NUM_LIT> ) ) ;


<s> case ARRAY_REF : case ARRAY_RANGE_REF : return true ; case NOP_EXPR : return bpf_is_valid_preserve_field_info_arg ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ;


<s> static void bpf_option_override ( void ) { init_machine_status = bpf_init_machine_status ; if ( TARGET_BPF_CORE && ! btf_debuginfo_p ( ) ) error ( <STR_LIT> ) ; if ( TARGET_BPF_CORE ) write_symbols |= BTF_WITH_CORE_DEBUG ; if ( flag_lto && TARGET_BPF_CORE ) sorry ( <STR_LIT> ) ; if ( btf_debuginfo_p ( ) && ! ( target_flags_explicit & MASK_BPF_CORE ) ) { target_flags |= MASK_BPF_CORE ; write_symbols |= BTF_WITH_CORE_DEBUG ; } if ( bpf_has_jmpext == - <NUM_LIT> ) bpf_has_jmpext = ( bpf_isa >= ISA_V2 ) ; if ( bpf_has_alu32 == - <NUM_LIT> ) bpf_has_alu32 = ( bpf_isa >= ISA_V3 ) ;


<s> if ( GET_MODE ( op ) == VOIDmode ) { if ( CONST_DOUBLE_HIGH ( op ) ) fprintf ( file , HOST_WIDE_INT_PRINT_DOUBLE_HEX , CONST_DOUBLE_HIGH ( op ) , CONST_DOUBLE_LOW ( op ) ) ; else if ( CONST_DOUBLE_LOW ( op ) < <NUM_LIT> ) fprintf ( file , HOST_WIDE_INT_PRINT_HEX , CONST_DOUBLE_LOW ( op ) ) ; else fprintf ( file , HOST_WIDE_INT_PRINT_DEC , CONST_DOUBLE_LOW ( op ) ) ; } else { long vals [ <NUM_LIT> ] ; real_to_target ( vals , CONST_DOUBLE_REAL_VALUE ( op ) , GET_MODE ( op ) ) ; vals [ <NUM_LIT> ] &= <NUM_LIT> ; vals [ <NUM_LIT> ] &= <NUM_LIT> ; if ( GET_MODE ( op ) == SFmode ) fprintf ( file , <STR_LIT> , vals [ <NUM_LIT> ] ) ; else if ( GET_MODE ( op ) == DFmode ) { if ( WORDS_BIG_ENDIAN ) fprintf ( file , <STR_LIT> , vals [ <NUM_LIT> ] , vals [ <NUM_LIT> ] ) ; else fprintf ( file , <STR_LIT> , vals [ <NUM_LIT> ] , vals [ <NUM_LIT> ] ) ; } else gcc_unreachable ( ) ; }


<s> else if ( CONST_DOUBLE_LOW ( op ) < <NUM_LIT> ) fprintf ( file , HOST_WIDE_INT_PRINT_HEX , CONST_DOUBLE_LOW ( op ) ) ; else fprintf ( file , HOST_WIDE_INT_PRINT_DEC , CONST_DOUBLE_LOW ( op ) ) ; } else { long vals [ <NUM_LIT> ] ; real_to_target ( vals , CONST_DOUBLE_REAL_VALUE ( op ) , GET_MODE ( op ) ) ; vals [ <NUM_LIT> ] &= <NUM_LIT> ; vals [ <NUM_LIT> ] &= <NUM_LIT> ; if ( GET_MODE ( op ) == SFmode ) fprintf ( file , <STR_LIT> , vals [ <NUM_LIT> ] ) ; else if ( GET_MODE ( op ) == DFmode ) { if ( WORDS_BIG_ENDIAN ) fprintf ( file , <STR_LIT> , vals [ <NUM_LIT> ] , vals [ <NUM_LIT> ] ) ;

else fprintf ( file , <STR_LIT> , vals [ <NUM_LIT> ] , vals [ <NUM_LIT> ] ) ;


<s> vec < tree , va_gc > * params = static_cast < vec < tree , va_gc > * > ( arglist ) ; unsigned n_params = params ? params -> length ( ) : <NUM_LIT> ; if ( ! ( which == BPF_BUILTIN_PRESERVE_ACCESS_INDEX && n_params == <NUM_LIT> ) && n_params != <NUM_LIT> ) { error_at ( loc , <STR_LIT> ) ; return error_mark_node ; } tree param = ( * params ) [ <NUM_LIT> ] ; if ( which == BPF_BUILTIN_PRESERVE_ACCESS_INDEX && ! TARGET_BPF_CORE ) return param ; else if ( which == BPF_BUILTIN_PRESERVE_FIELD_INFO && ! bpf_is_valid_preserve_field_info_arg ( param ) ) { error_at ( EXPR_LOC_OR_LOC ( param , loc ) , <STR_LIT> ) ; return error_mark_node ; }

if ( TREE_CODE ( param ) == C_MAYBE_CONST_EXPR ) param = C_MAYBE_CONST_EXPR_EXPR ( param ) ;


<s> static bool bpf_small_register_classes_for_mode_p ( machine_mode mode ) { if ( TARGET_XBPF ) return <NUM_LIT> ;


<s> static bool bpf_small_register_classes_for_mode_p ( machine_mode mode ) { if ( TARGET_XBPF ) return <NUM_LIT> ; else return ( mode != FUNCTION_MODE ) ;


<s> case LINUX_V4_7 : version_code = <STR_LIT> ; break ; case LINUX_V4_8 : version_code = <STR_LIT> ; break ; case LINUX_V4_9 : version_code = <STR_LIT> ; break ; case LINUX_V4_10 : version_code = <STR_LIT> ; break ; case LINUX_V4_11 : version_code = <STR_LIT> ; break ; case LINUX_V4_12 : version_code = <STR_LIT> ; break ; case LINUX_V4_13 : version_code = <STR_LIT> ; break ; case LINUX_V4_14 : version_code = <STR_LIT> ; break ; case LINUX_V4_15 : version_code = <STR_LIT> ; break ;

case LINUX_V4_16 : version_code = <STR_LIT> ; break ;


<s> tree expr = MEM_EXPR ( mem ) ; if ( ! expr ) continue ; if ( TREE_CODE ( expr ) == MEM_REF && TREE_CODE ( TREE_OPERAND ( expr , <NUM_LIT> ) ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) maybe_make_core_relo ( expr , BPF_RELO_FIELD_BYTE_OFFSET ) ;


<s> if ( ! expr ) continue ; if ( TREE_CODE ( expr ) == MEM_REF && TREE_CODE ( TREE_OPERAND ( expr , <NUM_LIT> ) ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) maybe_make_core_relo ( expr , BPF_RELO_FIELD_BYTE_OFFSET ) ; } } rtx_insn * seq = get_insns ( ) ; end_sequence ( ) ;


<s> if ( ! expr ) continue ; if ( TREE_CODE ( expr ) == MEM_REF && TREE_CODE ( TREE_OPERAND ( expr , <NUM_LIT> ) ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ;


<s> if ( GET_CODE ( pat ) != SET ) continue ; start_sequence ( ) ; for ( int i = <NUM_LIT> ; i < <NUM_LIT> ; i ++ ) { rtx mem = XEXP ( pat , i ) ; if ( MEM_P ( mem ) ) { tree expr = MEM_EXPR ( mem ) ; if ( ! expr ) continue ; if ( TREE_CODE ( expr ) == MEM_REF && TREE_CODE ( TREE_OPERAND ( expr , <NUM_LIT> ) ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) maybe_make_core_relo ( expr , BPF_RELO_FIELD_BYTE_OFFSET ) ; } } rtx_insn * seq = get_insns ( ) ; end_sequence ( ) ; emit_insn_before ( seq , insn ) ; } }


<s> auto_vec < unsigned int , <NUM_LIT> > accessors ; tree container = bpf_core_compute ( expr , & accessors ) ; if ( accessors . length ( ) < <NUM_LIT> ) return ; accessors . reverse ( ) ; rtx_code_label * label = gen_label_rtx ( ) ; LABEL_PRESERVE_P ( label ) = <NUM_LIT> ;


<s> auto_vec < unsigned int , <NUM_LIT> > accessors ; tree container = bpf_core_compute ( expr , & accessors ) ; if ( accessors . length ( ) < <NUM_LIT> ) return ; accessors . reverse ( ) ; rtx_code_label * label = gen_label_rtx ( ) ;

LABEL_PRESERVE_P ( label ) = <NUM_LIT> ;


<s> return ( GET_CODE ( x ) == REG && ( REGNO ( x ) < <NUM_LIT> || ( ! strict && REGNO ( x ) >= FIRST_PSEUDO_REGISTER ) ) ) ;


<s> if ( TARGET_BPF_CORE ) btf_ext_init ( ) ;


<s> fprintf ( asm_out_file , <STR_LIT> , name ) ;


<s> cfun -> machine -> local_vars_size += padding_locals ; if ( TARGET_XBPF ) { for ( regno = <NUM_LIT> ; regno < FIRST_PSEUDO_REGISTER ; regno ++ ) if ( ( df_regs_ever_live_p ( regno ) && ! call_used_or_fixed_reg_p ( regno ) ) || ( cfun -> calls_alloca && regno == STACK_POINTER_REGNUM ) ) cfun -> machine -> callee_saved_reg_size += <NUM_LIT> ; } if ( ( cfun -> machine -> local_vars_size + cfun -> machine -> callee_saved_reg_size ) > bpf_frame_limit ) { static int stack_limit_exceeded = <NUM_LIT> ; if ( ! stack_limit_exceeded ) error ( <STR_LIT> ) ; stack_limit_exceeded = <NUM_LIT> ;


<s> case COMPONENT_REF : accessors -> safe_push ( bpf_core_get_index ( TREE_OPERAND ( node , <NUM_LIT> ) ) ) ; break ; case ARRAY_REF : case ARRAY_RANGE_REF : accessors -> safe_push ( bpf_core_get_index ( node ) ) ; break ; case MEM_REF : accessors -> safe_push ( bpf_core_get_index ( node ) ) ; if ( TREE_CODE ( TREE_OPERAND ( node , <NUM_LIT> ) ) == ADDR_EXPR ) node = TREE_OPERAND ( TREE_OPERAND ( node , <NUM_LIT> ) , <NUM_LIT> ) ; goto done ; default : goto done ; } node = TREE_OPERAND ( node , <NUM_LIT> ) ; } done : return node ;


<s> } else if ( code == ARRAY_REF || code == ARRAY_RANGE_REF || code == MEM_REF ) { tree index = TREE_OPERAND ( node , <NUM_LIT> ) ; if ( TREE_CODE ( index ) == INTEGER_CST && tree_fits_shwi_p ( index ) ) return tree_to_shwi ( index ) ;


<s> enum tree_code code = TREE_CODE ( expr ) ; if ( code == COMPONENT_REF || code == ARRAY_REF ) return <NUM_LIT> ; if ( code == ADDR_EXPR ) return bpf_core_is_maybe_aggregate_access ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; return <NUM_LIT> ;


<s> static int bpf_core_is_maybe_aggregate_access ( tree expr ) { enum tree_code code = TREE_CODE ( expr ) ; if ( code == COMPONENT_REF || code == ARRAY_REF ) return <NUM_LIT> ;

if ( code == ADDR_EXPR ) return bpf_core_is_maybe_aggregate_access ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ;


<s> len = snprintf ( name + len , sizeof ( name ) - len , <STR_LIT> , cnt ++ ) ; return add_builtin_function_ext_scope ( name , rettype , - <NUM_LIT> , BUILT_IN_MD , NULL , NULL_TREE ) ;


<s> location_t loc = * ( ( location_t * ) data ) ; if ( TYPE_P ( * tp ) ) { * walk_subtrees = <NUM_LIT> ; return NULL_TREE ; } if ( bpf_core_is_maybe_aggregate_access ( * tp ) ) {

tree newdecl = bpf_core_newdecl ( TREE_TYPE ( * tp ) ) ;


<s> tree newdecl = bpf_core_newdecl ( TREE_TYPE ( * tp ) ) ; tree newcall = build_call_expr_loc ( loc , newdecl , <NUM_LIT> , * tp ) ; * tp = newcall ; * walk_subtrees = <NUM_LIT> ;


<s> static enum unwind_info_type bpf_debug_unwind_info ( ) { return UI_NONE ;


<s> static enum unwind_info_type bpf_debug_unwind_info ( ) {


<s> enum insn_code abs_icode = ( code == BPF_BUILTIN_LOAD_BYTE ? CODE_FOR_ldabsb : code == BPF_BUILTIN_LOAD_HALF ? CODE_FOR_ldabsh : CODE_FOR_ldabsw ) ; enum insn_code ind_icode = ( code == BPF_BUILTIN_LOAD_BYTE ? CODE_FOR_ldindb : code == BPF_BUILTIN_LOAD_HALF ? CODE_FOR_ldindh : CODE_FOR_ldindw ) ; tree offset_arg = CALL_EXPR_ARG ( exp , <NUM_LIT> ) ; struct expand_operand ops [ <NUM_LIT> ] ; create_input_operand ( & ops [ <NUM_LIT> ] , expand_normal ( offset_arg ) , TYPE_MODE ( TREE_TYPE ( offset_arg ) ) ) ; create_input_operand ( & ops [ <NUM_LIT> ] , const0_rtx , SImode ) ; if ( ! maybe_expand_insn ( abs_icode , <NUM_LIT> , ops ) && ! maybe_expand_insn ( ind_icode , <NUM_LIT> , ops ) ) { error ( <STR_LIT> ) ; return gen_rtx_REG ( ops [ <NUM_LIT> ] . mode , BPF_R0 ) ;


<s> enum rtx_code code = GET_CODE ( operands [ <NUM_LIT> ] ) ; if ( ( code == LT || code == LE || code == LTU || code == LEU ) ) { PUT_CODE ( operands [ <NUM_LIT> ] , reverse_condition ( code ) ) ; if ( ! register_operand ( operands [ <NUM_LIT> ] , mode ) ) operands [ <NUM_LIT> ] = force_reg ( mode , operands [ <NUM_LIT> ] ) ; rtx tmp = operands [ <NUM_LIT> ] ;

operands [ <NUM_LIT> ] = operands [ <NUM_LIT> ] ;


<s> rtx mem ; if ( ! IN_RANGE ( fp_offset , - <NUM_LIT> - <NUM_LIT> , <NUM_LIT> ) ) break ; else { mem = gen_frame_mem ( DImode , plus_constant ( DImode , hard_frame_pointer_rtx , fp_offset - <NUM_LIT> ) ) ; insn = emit_move_insn ( gen_rtx_REG ( DImode , regno ) , mem ) ; fp_offset -= <NUM_LIT> ; } } }


<s> rtx insn ; int regno ; int fp_offset = - cfun -> machine -> local_vars_size ; for ( regno = <NUM_LIT> ; regno < FIRST_PSEUDO_REGISTER ; regno ++ ) { if ( ( df_regs_ever_live_p ( regno ) && ! call_used_or_fixed_reg_p ( regno ) ) || ( cfun -> calls_alloca && regno == STACK_POINTER_REGNUM ) ) { rtx mem ; if ( ! IN_RANGE ( fp_offset , - <NUM_LIT> - <NUM_LIT> , <NUM_LIT> ) ) break ; else { mem = gen_frame_mem ( DImode , plus_constant ( DImode , hard_frame_pointer_rtx , fp_offset - <NUM_LIT> ) ) ; insn = emit_move_insn ( gen_rtx_REG ( DImode , regno ) , mem ) ;


<s> void bpf_expand_prologue ( void ) { rtx insn ; HOST_WIDE_INT size ; size = ( cfun -> machine -> local_vars_size + cfun -> machine -> callee_saved_reg_size ) ; if ( TARGET_XBPF ) { int regno ; int fp_offset = - cfun -> machine -> local_vars_size ; for ( regno = <NUM_LIT> ; regno < FIRST_PSEUDO_REGISTER ; regno ++ ) { if ( ( df_regs_ever_live_p ( regno ) && ! call_used_or_fixed_reg_p ( regno ) ) || ( cfun -> calls_alloca && regno == STACK_POINTER_REGNUM ) ) { rtx mem ;

if ( ! IN_RANGE ( fp_offset , - <NUM_LIT> - <NUM_LIT> , <NUM_LIT> ) ) break ;


<s> insn = emit_move_insn ( mem , gen_rtx_REG ( DImode , regno ) ) ; fp_offset -= <NUM_LIT> ; } } } } if ( cfun -> calls_alloca ) { insn = emit_move_insn ( stack_pointer_rtx , hard_frame_pointer_rtx ) ; if ( size > <NUM_LIT> ) {

insn = emit_insn ( gen_rtx_SET ( stack_pointer_rtx , gen_rtx_PLUS ( Pmode , stack_pointer_rtx , GEN_INT ( - size ) ) ) ) ;


if ( TARGET_BPF_CORE ) btf_ext_output ( ) ;


<s> static bool bpf_frame_pointer_required ( void ) { return true ;


<s> if ( * cum < <NUM_LIT> ) return gen_rtx_REG ( arg . mode , * cum + <NUM_LIT> ) ;


<s> if ( * cum <= <NUM_LIT> && * cum + num_words > <NUM_LIT> ) error ( <STR_LIT> ) ;


<s> int unsignedp ; mode = TYPE_MODE ( ret_type ) ;

if ( INTEGRAL_TYPE_P ( ret_type ) ) mode = promote_function_mode ( ret_type , mode , & unsignedp , fntype_or_decl , <NUM_LIT> ) ;


<s> static tree bpf_handle_fndecl_attribute ( tree * node , tree name , tree args , int flags ATTRIBUTE_UNUSED , bool * no_add_attrs ) { if ( TREE_CODE ( * node ) != FUNCTION_DECL ) { warning ( OPT_Wattributes , <STR_LIT> , name ) ; * no_add_attrs = true ; } if ( is_attribute_p ( <STR_LIT> , name ) ) { if ( args ) { tree cst = TREE_VALUE ( args ) ; if ( TREE_CODE ( cst ) != INTEGER_CST ) { warning ( OPT_Wattributes , <STR_LIT> , name ) ; * no_add_attrs = true ; }


warning ( OPT_Wattributes , <STR_LIT> , name ) ;


<s> if ( TREE_CODE ( * node ) != RECORD_TYPE && TREE_CODE ( * node ) != UNION_TYPE ) { warning ( OPT_Wattributes , <STR_LIT> , name ) ; * no_add_attrs = true ; } return NULL_TREE ;


<s> case E_SImode : case E_DImode : case E_HImode : case E_QImode : case E_TImode : case E_SFmode : case E_DFmode :


<s> return CEIL ( GET_MODE_SIZE ( mode ) , UNITS_PER_WORD ) ;


<s> static inline int bpf_helper_code ( const char * name ) { int i ; for ( i = <NUM_LIT> ; i < BPF_BUILTIN_HELPER_MAX ; ++ i ) if ( strcmp ( name , bpf_helper_names [ i ] ) == <NUM_LIT> ) return i ; return <NUM_LIT> ;


<s> int i ; for ( i = <NUM_LIT> ; i < BPF_BUILTIN_HELPER_MAX ; ++ i ) if ( strcmp ( name , bpf_helper_names [ i ] ) == <NUM_LIT> ) return i ; return <NUM_LIT> ;


<s> else if ( from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM ) ret = <NUM_LIT> ; else gcc_unreachable ( ) ;


<s> if ( from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM ) ret = ( cfun -> machine -> local_vars_size + cfun -> machine -> callee_saved_reg_size ) ; else if ( from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM ) ret = <NUM_LIT> ;


<s> tree ullt = long_long_unsigned_type_node ; def_builtin ( <STR_LIT> , BPF_BUILTIN_LOAD_BYTE , build_function_type_list ( ullt , ullt , <NUM_LIT> ) ) ; def_builtin ( <STR_LIT> , BPF_BUILTIN_LOAD_HALF , build_function_type_list ( ullt , ullt , <NUM_LIT> ) ) ;

def_builtin ( <STR_LIT> , BPF_BUILTIN_LOAD_WORD , build_function_type_list ( ullt , ullt , <NUM_LIT> ) ) ;


<s> set_conv_libfunc ( sfix_optab , SImode , DFmode , <STR_LIT> ) ; set_conv_libfunc ( sfloat_optab , DFmode , SImode , <STR_LIT> ) ; set_conv_libfunc ( ufloat_optab , DFmode , SImode , <STR_LIT> ) ;


<s> return ggc_cleared_alloc < machine_function > ( ) ;


<s> rtx x0 = XEXP ( x , <NUM_LIT> ) ; rtx x1 = XEXP ( x , <NUM_LIT> ) ; if ( bpf_address_base_p ( x0 , strict ) && GET_CODE ( x1 ) == CONST_INT ) return IN_RANGE ( INTVAL ( x1 ) , - <NUM_LIT> - <NUM_LIT> , <NUM_LIT> ) ;


<s> if ( TARGET_BPF_CORE ) write_symbols |= BTF_WITH_CORE_DEBUG ; if ( flag_lto && TARGET_BPF_CORE ) sorry ( <STR_LIT> ) ; if ( btf_debuginfo_p ( ) && ! ( target_flags_explicit & MASK_BPF_CORE ) ) { target_flags |= MASK_BPF_CORE ;


<s> if ( decl && ( attr = lookup_attribute ( <STR_LIT> , DECL_ATTRIBUTES ( decl ) ) ) ) { tree attr_args = TREE_VALUE ( attr ) ; xops [ <NUM_LIT> ] = GEN_INT ( TREE_INT_CST_LOW ( TREE_VALUE ( attr_args ) ) ) ; output_asm_insn ( <STR_LIT> , xops ) ; } else output_asm_insn ( <STR_LIT> , & target ) ; break ; } default : if ( TARGET_XBPF ) output_asm_insn ( <STR_LIT> , & target ) ; else {


<s> static void bpf_output_constructor ( rtx symbol , int priority ATTRIBUTE_UNUSED ) { tree decl = SYMBOL_REF_DECL ( symbol ) ; if ( decl ) sorry_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> ) ; else sorry ( <STR_LIT> ) ;


<s> if ( decl ) sorry_at ( DECL_SOURCE_LOCATION ( decl ) , <STR_LIT> ) ;


<s> static bool bpf_pass_by_reference ( cumulative_args_t cum ATTRIBUTE_UNUSED , const function_arg_info & arg ) {

unsigned num_bytes = arg . type_size_in_bytes ( ) ;


<s> return ( arg . aggregate_type_p ( ) || ( num_bytes > <NUM_LIT> * <NUM_LIT> ) ) ;


<s> void bpf_print_operand ( FILE * file , rtx op , int code ATTRIBUTE_UNUSED ) { switch ( GET_CODE ( op ) ) { case REG : fprintf ( file , <STR_LIT> , reg_names [ REGNO ( op ) ] ) ; break ; case MEM : output_address ( GET_MODE ( op ) , XEXP ( op , <NUM_LIT> ) ) ; break ; case CONST_DOUBLE : if ( CONST_DOUBLE_HIGH ( op ) ) fprintf ( file , HOST_WIDE_INT_PRINT_DOUBLE_HEX , CONST_DOUBLE_HIGH ( op ) , CONST_DOUBLE_LOW ( op ) ) ; else if ( CONST_DOUBLE_LOW ( op ) < <NUM_LIT> ) fprintf ( file , HOST_WIDE_INT_PRINT_HEX , CONST_DOUBLE_LOW ( op ) ) ; else fprintf ( file , HOST_WIDE_INT_PRINT_DEC , CONST_DOUBLE_LOW ( op ) ) ; break ; default : output_addr_const ( file , op ) ; }


<s> break ; case CONST_DOUBLE : if ( CONST_DOUBLE_HIGH ( op ) ) fprintf ( file , HOST_WIDE_INT_PRINT_DOUBLE_HEX , CONST_DOUBLE_HIGH ( op ) , CONST_DOUBLE_LOW ( op ) ) ; else if ( CONST_DOUBLE_LOW ( op ) < <NUM_LIT> ) fprintf ( file , HOST_WIDE_INT_PRINT_HEX , CONST_DOUBLE_LOW ( op ) ) ; else fprintf ( file , HOST_WIDE_INT_PRINT_DEC , CONST_DOUBLE_LOW ( op ) ) ; break ; default : output_addr_const ( file , op ) ; }


<s> output_addr_const ( file , op1 ) ; fputs ( <STR_LIT> , file ) ; } else fatal_insn ( <STR_LIT> , addr ) ; break ; } case MEM : case LABEL_REF : fatal_insn ( <STR_LIT> , addr ) ; break ; default : output_addr_const ( file , addr ) ;


<s> static bool bpf_rtx_costs ( rtx x ATTRIBUTE_UNUSED , enum machine_mode mode ATTRIBUTE_UNUSED , int outer_code ATTRIBUTE_UNUSED , int opno ATTRIBUTE_UNUSED , int * total ATTRIBUTE_UNUSED , bool speed ATTRIBUTE_UNUSED ) {


<s> builtin_define ( <STR_LIT> ) ; if ( TARGET_BIG_ENDIAN ) builtin_define ( <STR_LIT> ) ; else builtin_define ( <STR_LIT> ) ; { const char * version_code ; char * kernel_version_code ; switch ( bpf_kernel ) { case LINUX_V4_0 : version_code = <STR_LIT> ; break ; case LINUX_V4_1 : version_code = <STR_LIT> ; break ; case LINUX_V4_2 : version_code = <STR_LIT> ; break ; case LINUX_V4_3 : version_code = <STR_LIT> ; break ; case LINUX_V4_4 : version_code = <STR_LIT> ; break ; case LINUX_V4_5 : version_code = <STR_LIT> ; break ; case LINUX_V4_6 : version_code = <STR_LIT> ; break ; case LINUX_V4_7 : version_code = <STR_LIT> ; break ; case LINUX_V4_8 : version_code = <STR_LIT> ; break ; case LINUX_V4_9 : version_code = <STR_LIT> ; break ; case LINUX_V4_10 : version_code = <STR_LIT> ; break ; case LINUX_V4_11 : version_code = <STR_LIT> ; break ; case LINUX_V4_12 : version_code = <STR_LIT> ; break ; case LINUX_V4_13 : version_code = <STR_LIT> ; break ; case LINUX_V4_14 : version_code = <STR_LIT> ; break ;

case LINUX_V4_15 : version_code = <STR_LIT> ; break ;


<s> case LINUX_V4_3 : version_code = <STR_LIT> ; break ; case LINUX_V4_4 : version_code = <STR_LIT> ; break ; case LINUX_V4_5 : version_code = <STR_LIT> ; break ; case LINUX_V4_6 : version_code = <STR_LIT> ; break ; case LINUX_V4_7 : version_code = <STR_LIT> ; break ; case LINUX_V4_8 : version_code = <STR_LIT> ; break ; case LINUX_V4_9 : version_code = <STR_LIT> ; break ; case LINUX_V4_10 : version_code = <STR_LIT> ; break ; case LINUX_V4_11 : version_code = <STR_LIT> ; break ; case LINUX_V4_12 : version_code = <STR_LIT> ; break ; case LINUX_V4_13 : version_code = <STR_LIT> ; break ; case LINUX_V4_14 : version_code = <STR_LIT> ; break ; case LINUX_V4_15 : version_code = <STR_LIT> ; break ; case LINUX_V4_16 : version_code = <STR_LIT> ; break ; case LINUX_V4_17 : version_code = <STR_LIT> ; break ; case LINUX_V4_18 : version_code = <STR_LIT> ; break ; case LINUX_V4_19 : version_code = <STR_LIT> ; break ; case LINUX_V4_20 : version_code = <STR_LIT> ; break ; case LINUX_V5_0 : version_code = <STR_LIT> ; break ; case LINUX_V5_1 : version_code = <STR_LIT> ; break ;

case LINUX_V5_2 : version_code = <STR_LIT> ; break ;


<s> tree t = add_builtin_function ( name , type , code , BUILT_IN_MD , NULL , NULL_TREE ) ;


<s> handle_attr_preserve ( fn ) ; return <NUM_LIT> ;


<s> if ( ! NONJUMP_INSN_P ( insn ) ) continue ; rtx pat = PATTERN ( insn ) ; if ( GET_CODE ( pat ) != SET ) continue ; start_sequence ( ) ; for ( int i = <NUM_LIT> ; i < <NUM_LIT> ; i ++ ) { rtx mem = XEXP ( pat , i ) ; if ( MEM_P ( mem ) ) { tree expr = MEM_EXPR ( mem ) ; if ( ! expr ) continue ; if ( TREE_CODE ( expr ) == MEM_REF && TREE_CODE ( TREE_OPERAND ( expr , <NUM_LIT> ) ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) { auto_vec < unsigned int , <NUM_LIT> > accessors ;

tree container = bpf_core_compute ( expr , & accessors ) ;


<s> gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) { auto_vec < unsigned int , <NUM_LIT> > accessors ; tree container = bpf_core_compute ( expr , & accessors ) ; if ( accessors . length ( ) < <NUM_LIT> ) continue ; accessors . reverse ( ) ; container = TREE_TYPE ( container ) ; const char * section_name ; if ( DECL_SECTION_NAME ( fn -> decl ) ) section_name = DECL_SECTION_NAME ( fn -> decl ) ; else section_name = <STR_LIT> ; label = gen_label_rtx ( ) ; LABEL_PRESERVE_P ( label ) = <NUM_LIT> ;


<s> gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) { auto_vec < unsigned int , <NUM_LIT> > accessors ; tree container = bpf_core_compute ( expr , & accessors ) ; if ( accessors . length ( ) < <NUM_LIT> ) continue ; accessors . reverse ( ) ; container = TREE_TYPE ( container ) ; const char * section_name ; if ( DECL_SECTION_NAME ( fn -> decl ) ) section_name = DECL_SECTION_NAME ( fn -> decl ) ; else section_name = <STR_LIT> ; label = gen_label_rtx ( ) ; LABEL_PRESERVE_P ( label ) = <NUM_LIT> ; emit_label ( label ) ; bpf_core_reloc_add ( container , section_name , & accessors , label ) ;


<s> FOR_EACH_BB_FN ( bb , fn ) { FOR_BB_INSNS ( bb , insn ) { if ( ! NONJUMP_INSN_P ( insn ) ) continue ; rtx pat = PATTERN ( insn ) ; if ( GET_CODE ( pat ) != SET ) continue ; start_sequence ( ) ; for ( int i = <NUM_LIT> ; i < <NUM_LIT> ; i ++ ) { rtx mem = XEXP ( pat , i ) ; if ( MEM_P ( mem ) ) { tree expr = MEM_EXPR ( mem ) ; if ( ! expr ) continue ; if ( TREE_CODE ( expr ) == MEM_REF && TREE_CODE ( TREE_OPERAND ( expr , <NUM_LIT> ) ) == SSA_NAME ) { gimple * def_stmt = SSA_NAME_DEF_STMT ( TREE_OPERAND ( expr , <NUM_LIT> ) ) ; if ( def_stmt && is_gimple_assign ( def_stmt ) ) expr = gimple_assign_rhs1 ( def_stmt ) ; } if ( is_attr_preserve_access ( expr ) ) { auto_vec < unsigned int , <NUM_LIT> > accessors ; tree container = bpf_core_compute ( expr , & accessors ) ;

if ( accessors . length ( ) < <NUM_LIT> ) continue ;


<s> tree container = bpf_core_compute ( expr , & accessors ) ; if ( accessors . length ( ) < <NUM_LIT> ) continue ; accessors . reverse ( ) ; container = TREE_TYPE ( container ) ; const char * section_name ; if ( DECL_SECTION_NAME ( fn -> decl ) ) section_name = DECL_SECTION_NAME ( fn -> decl ) ; else section_name = <STR_LIT> ; label = gen_label_rtx ( ) ; LABEL_PRESERVE_P ( label ) = <NUM_LIT> ; emit_label ( label ) ; bpf_core_reloc_add ( container , section_name , & accessors , label ) ; } } } rtx_insn * seq = get_insns ( ) ; end_sequence ( ) ; emit_insn_before ( seq , insn ) ; } }


<s> tree base = get_inner_reference ( t , & bitsize , & bitpos , & var_off , & mode , & sign , & reverse , & vol ) ; if ( TREE_CODE ( base ) == MEM_REF ) { return lookup_attribute ( <STR_LIT> , TYPE_ATTRIBUTES ( TREE_TYPE ( base ) ) ) ; } if ( TREE_CODE ( t ) == COMPONENT_REF ) { const tree op = TREE_OPERAND ( t , <NUM_LIT> ) ; if ( TREE_CODE ( op ) == COMPONENT_REF ) return is_attr_preserve_access ( op ) ; const tree container = DECL_CONTEXT ( TREE_OPERAND ( t , <NUM_LIT> ) ) ; return lookup_attribute ( <STR_LIT> , TYPE_ATTRIBUTES ( container ) ) ; } else if ( TREE_CODE ( t ) == ADDR_EXPR ) return is_attr_preserve_access ( TREE_OPERAND ( t , <NUM_LIT> ) ) ; return false ;


<s> rtl_opt_pass * make_pass_bpf_core_attr ( gcc :: context * ctxt ) { return new pass_bpf_core_attr ( ctxt ) ;


<s> pass_bpf_core_attr ( gcc :: context * ctxt ) : rtl_opt_pass ( pass_data_bpf_core_attr , ctxt ) {


<s> if ( TREE_CODE ( node ) == FIELD_DECL ) { const tree container = DECL_CONTEXT ( node ) ; dw_die_ref die = lookup_type_die ( container ) ; if ( die == NULL ) return - <NUM_LIT> ; ctf_dtdef_ref dtd = ctf_dtd_lookup ( ctfc , die ) ;


<s> for ( dmd = dtd -> dtd_u . dtu_members ; dmd != NULL ; dmd = ( ctf_dmdef_t * ) ctf_dmd_list_next ( dmd ) ) { bool field_has_btf = get_btf_id ( dmd -> dmd_type ) <= BTF_MAX_TYPE ; if ( field == node ) return field_has_btf ? i : - <NUM_LIT> ;


<s> bpf_core_reloc_ref bpfcr = ggc_cleared_alloc < bpf_core_reloc_t > ( ) ; ctf_container_ref ctfc = ctf_get_tu_ctfc ( ) ; ctf_add_string ( ctfc , buf , & ( bpfcr -> bpfcr_astr_off ) , CTF_AUX_STRTAB ) ; bpfcr -> bpfcr_type = get_btf_id ( ctf_lookup_tree_type ( ctfc , type ) ) ; bpfcr -> bpfcr_insn_label = label ; bpfcr -> bpfcr_kind = kind ; bpf_core_section_ref sec ; FOR_EACH_VEC_ELT ( * bpf_core_sections , i , sec ) if ( strcmp ( sec -> name , section_name ) == <NUM_LIT> ) { vec_safe_push ( sec -> relocs , bpfcr ) ; return ;


<s> unsigned int kind = CTF_V2_INFO_KIND ( dtd -> dtd_data . ctti_info ) ; if ( kind != CTF_K_STRUCT && kind != CTF_K_UNION ) return - <NUM_LIT> ; int i = <NUM_LIT> ; ctf_dmdef_t * dmd ; for ( dmd = dtd -> dtd_u . dtu_members ; dmd != NULL ; dmd = ( ctf_dmdef_t * ) ctf_dmd_list_next ( dmd ) ) { if ( get_btf_id ( dmd -> dmd_type ) > BTF_MAX_TYPE ) continue ; if ( strcmp ( dmd -> dmd_name , name ) == <NUM_LIT> ) return i ; i ++ ; }


<s> if ( accessors -> length ( ) < <NUM_LIT> ) return ; for ( i = <NUM_LIT> ; i < accessors -> length ( ) - <NUM_LIT> ; i ++ ) n += snprintf ( buf + n , sizeof ( buf ) - n , <STR_LIT> , ( * accessors ) [ i ] ) ; snprintf ( buf + n , sizeof ( buf ) - n , <STR_LIT> , ( * accessors ) [ i ] ) ; bpf_core_reloc_ref bpfcr = ggc_cleared_alloc < bpf_core_reloc_t > ( ) ; ctf_container_ref ctfc = ctf_get_tu_ctfc ( ) ; ctf_add_string ( ctfc , buf , & ( bpfcr -> bpfcr_astr_off ) , CTF_AUX_STRTAB ) ; bpfcr -> bpfcr_type = get_btf_id ( ctf_lookup_tree_type ( ctfc , type ) ) ; bpfcr -> bpfcr_insn_label = label ; bpfcr -> bpfcr_kind = BPF_RELO_FIELD_BYTE_OFFSET ; bpf_core_section_ref sec ;

FOR_EACH_VEC_ELT ( * bpf_core_sections , i , sec ) if ( strcmp ( sec -> name , section_name ) == <NUM_LIT> ) {


<s> void btf_ext_init ( void ) { btf_ext_info_section = get_section ( BTF_EXT_INFO_SECTION_NAME , BTF_EXT_INFO_SECTION_FLAGS , NULL ) ; ASM_GENERATE_INTERNAL_LABEL ( btf_ext_info_section_label , BTF_EXT_INFO_SECTION_LABEL , btf_ext_label_num ++ ) ;


<s> output_btfext_header ( ) ; output_btfext_core_sections ( ) ;


<s> output_btfext_header ( ) ; output_btfext_core_sections ( ) ; bpf_core_sections = NULL ;


<s> bpf_core_reloc_ref bpfcr ; FOR_EACH_VEC_ELT ( * ( sec -> relocs ) , i , bpfcr ) output_asm_btfext_core_reloc ( bpfcr ) ;


<s> static void output_btfext_core_sections ( void ) { size_t i ; bpf_core_section_ref sec ; dw2_asm_output_data ( <NUM_LIT> , sizeof ( struct btf_ext_reloc ) , <STR_LIT> ) ; FOR_EACH_VEC_ELT ( * bpf_core_sections , i , sec ) { sec -> name_offset += ctfc_get_strtab_len ( ctf_get_tu_ctfc ( ) , CTF_STRTAB ) ; dw2_asm_output_data ( <NUM_LIT> , sec -> name_offset , <STR_LIT> ) ; dw2_asm_output_data ( <NUM_LIT> , vec_safe_length ( sec -> relocs ) , <STR_LIT> ) ;