(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:obj) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [7] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children: [(C {<file>} {(${ Id.VSub_Name obj)}) (C {<grep>} {<-q>} {<ELF>})] negated: F ) (command.Subshell child: (command.CommandList children: [ (command.Sentence child: (command.Simple words: [{<echo>} {(DQ (${ Id.VSub_Name obj) <' is not and ELF file.'>)}] redirects: [ (redir op: <Id.Redir_GreatAnd '1>&'> loc: (redir_loc.Fd fd:1) arg: {<2>} ) ] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] ) ) ] ) (command.Simple words: [{<objdump>} {<-hj>} {<__ex_table>} {(${ Id.VSub_Name obj)}] redirects: [ (redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>}) (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>}) ] do_fork: T ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:white_list) op: assign_op.Equal rhs: {<.text> <Id.Lit_Comma ','> <.fixup>} spids: [86] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:suspicious_relocs) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<objdump>} {<-rj>} {<__ex_table>} {(${ Id.VSub_Name obj)}) (C {<tail>} {<-n>} {<Id.Lit_Other '+'> <6>}) (C {<grep>} {<-v>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<eval>} {<echo>} {<-e> <Id.Lit_LBrace '{'> (${ Id.VSub_Name white_list) <Id.Lit_RBrace '}'> } ) ) } ) (C {<awk>} {(SQ <'{print $3}'>)}) ] negated: F ) ) } spids: [92] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name suspicious_relocs))} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] ) (command.ShFunction name: find_section_offset_from_symbol body: (command.BraceGroup children: [ (C {<eval>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<objdump>} {<-t>} {(${ Id.VSub_Name obj)}) (C {<grep>} {(${ Id.VSub_Number 1)}) (C {<sed>} { (SQ < 's/\\([0-9a-f]\\+\\) .\\{7\\} \\([^ \\t]\\+\\).*/section="\\2"; section_offset="0x\\1" /' > ) } ) ] negated: F ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:section_offset) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<printf>} {(DQ <'0x%016x'>)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: {(${ Id.VSub_Name section_offset)} right: {($ Id.VSub_Number '$2')} ) ) } ) ) } spids: [234] ) ] ) ] ) ) (command.ShFunction name: find_symbol_and_offset_from_reloc body: (command.BraceGroup children: [ (C {<eval>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$reloc')}) (C {<sed>} { (SQ < 's/\\([^+]\\+\\)+\\?\\(0x[0-9a-f]\\+\\)\\?/symbol="\\1"; symbol_offset="\\2"/' > ) } ) ] negated: F ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ (${ Id.VSub_Name symbol_offset))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:symbol_offset) op: assign_op.Equal rhs: {<0x0>} spids: [317] ) ] ) ] spids: [299 314] ) ] ) ] ) ) (command.ShFunction name: find_alt_replacement_target body: (command.BraceGroup children: [ (C {<eval>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<objdump>} {<-rj>} {<.altinstructions>} {(${ Id.VSub_Name obj)}) (C {<grep>} {<-B1>} {(DQ (${ Id.VSub_Name section) <'+'> (${ Id.VSub_Name section_offset))} ) (C {<head>} {<-n1>}) (C {<awk>} {(SQ <'{print $3}'>)}) (C {<sed>} { (SQ < 's/\\([^+]\\+\\)+\\(0x[0-9a-f]\\+\\)/alt_target_section="\\1"; alt_target_offset="\\2"/' > ) } ) ] negated: F ) ) } ) ] ) ) (command.ShFunction name: handle_alt_replacement_reloc body: (command.BraceGroup children: [ (C {<find_alt_replacement_target>} {(${ Id.VSub_Name section)} {(${ Id.VSub_Name section_offset)} ) (C {<echo>} {(DQ <'Error: found a reference to .altinstr_replacement in __ex_table:'>)}) (command.Pipeline children: [ (C {<addr2line>} {<-fip>} {<-j>} {(${ Id.VSub_Name alt_target_section)} {<-e>} {(${ Id.VSub_Name obj)} {(${ Id.VSub_Name alt_target_offset)} ) (C {<awk>} {(SQ <'{print "\\t" $0}'>)}) ] negated: F ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:error) op: assign_op.Equal rhs: {<true>} spids: [461] ) ] ) ] ) ) (command.ShFunction name: is_executable_section body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {<objdump>} {<-hwj>} {(${ Id.VSub_Name section)} {(${ Id.VSub_Name obj)}) (C {<grep>} {<-q>} {<CODE>}) ] negated: F ) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {($ Id.VSub_QMark '$?')} ) ] ) ) (command.ShFunction name: handle_suspicious_generic_reloc body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<is_executable_section>} {(${ Id.VSub_Name section)}) terminator: <Id.Op_Semi _> ) ] action: [ (C {<echo>} { (DQ <'Warning: found a reference to section '> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ) (${ Id.VSub_Name section) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' in __ex_table:'> ) } ) (command.Pipeline children: [ (C {<addr2line>} {<-fip>} {<-j>} {(${ Id.VSub_Name section)} {<-e>} {(${ Id.VSub_Name obj)} {(${ Id.VSub_Name section_offset)} ) (C {<awk>} {(SQ <'{print "\\t" $0}'>)}) ] negated: F ) ] spids: [513 522] ) ] else_action: [ (C {<echo>} { (DQ <'Error: found a reference to non-executable section '> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ) (${ Id.VSub_Name section) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' in __ex_table at offset '> (${ Id.VSub_Name section_offset) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:error) op: assign_op.Equal rhs: {<true>} spids: [614] ) ] ) ] ) ] ) ) (command.ShFunction name: handle_suspicious_reloc body: (command.BraceGroup children: [ (command.Case to_match: {(DQ (${ Id.VSub_Name section))} arms: [ (case_arm pat_list: [{(DQ <.altinstr_replacement>)}] action: [ (C {<handle_alt_replacement_reloc>} {(${ Id.VSub_Name section)} {(${ Id.VSub_Name section_offset)} ) ] spids: [643 646 660 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (C {<handle_suspicious_generic_reloc>} {(${ Id.VSub_Name section)} {(${ Id.VSub_Name section_offset)} ) ] spids: [663 664 678 -1] ) ] ) ] ) ) (command.ShFunction name: diagnose body: (command.BraceGroup children: [ (command.ForEach iter_name: reloc iter_words: [{(${ Id.VSub_Name suspicious_relocs)}] do_arg_iter: F body: (command.DoGroup children: [ (C {<find_symbol_and_offset_from_reloc>} {(${ Id.VSub_Name reloc)}) (C {<find_section_offset_from_symbol>} {(${ Id.VSub_Name symbol)} {(${ Id.VSub_Name symbol_offset)} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$section')}) (C {<grep>} {<-v>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<eval>} {<echo>} {<-e> <Id.Lit_LBrace '{'> (${ Id.VSub_Name white_list) <Id.Lit_RBrace '}'> } ) ) } ) ] negated: F ) ) ) } {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (command.ControlFlow token:<Id.ControlFlow_Continue continue>) terminator: <Id.Op_Semi _> ) ] spids: [766 803] ) ] ) (C {<handle_suspicious_reloc>}) ] ) ) ] ) ) (command.ShFunction name: check_debug_info body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{<objdump>} {<-hj>} {<.debug_info>} {(${ Id.VSub_Name obj)}] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] do_fork: T ) (C {<echo>} {<-e>} { (DQ (${ Id.VSub_Name obj) <' does not contain debug information, the addr2line output will be limited.'> <Id.Lit_Other '\\'> <n> ) } {(DQ <'Recompile '> (${ Id.VSub_Name obj) <' with CONFIG_DEBUG_INFO to get a more useful output.'>)} ) ] ) ] ) ) (C {<check_debug_info>}) (C {<diagnose>}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name error))} {<Id.Lit_RBracket ']'>}) terminator: <Id.Op_Semi _> ) ] action: [(command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})] spids: [892 905] ) ] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )