1 // SPDX-License-Identifier: GPL-2.0
10 static struct ins_ops
*arm__associate_instruction_ops(struct arch
*arch
, const char *name
)
12 struct arm_annotate
*arm
= arch
->priv
;
16 if (!regexec(&arm
->call_insn
, name
, 2, match
, 0))
18 else if (!regexec(&arm
->jump_insn
, name
, 2, match
, 0))
23 arch__associate_ins_ops(arch
, name
, ops
);
27 static int arm__annotate_init(struct arch
*arch
)
29 struct arm_annotate
*arm
;
32 if (arch
->initialized
)
35 arm
= zalloc(sizeof(*arm
));
39 #define ARM_CONDS "(cc|cs|eq|ge|gt|hi|le|ls|lt|mi|ne|pl|vc|vs)"
40 err
= regcomp(&arm
->call_insn
, "^blx?" ARM_CONDS
"?$", REG_EXTENDED
);
43 err
= regcomp(&arm
->jump_insn
, "^bx?" ARM_CONDS
"?$", REG_EXTENDED
);
48 arch
->initialized
= true;
50 arch
->associate_instruction_ops
= arm__associate_instruction_ops
;
51 arch
->objdump
.comment_char
= ';';
52 arch
->objdump
.skip_functions_char
= '+';
56 regfree(&arm
->call_insn
);