mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
objtool/LoongArch: Mark types based on break immediate code
If the break immediate code is 0, it should mark the type as INSN_TRAP. If the break immediate code is 1, it should mark the type as INSN_BUG. While at it, format the code style and add the code comment for nop. Cc: [email protected] Suggested-by: WANG Rui <[email protected]> Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
This commit is contained in:
1 parent
f83ec76bf2
commit
baad7830ee
1 file changed
+9
-3
@@ -310,10 +310,16 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
|
||||
if (decode_insn_reg2i16_fomat(inst, insn))
|
||||
return 0;
|
||||
|
||||
if (inst.word == 0)
|
||||
if (inst.word == 0) {
|
||||
/* andi $zero, $zero, 0x0 */
|
||||
insn->type = INSN_NOP;
|
||||
else if (inst.reg0i15_format.opcode == break_op) {
|
||||
/* break */
|
||||
} else if (inst.reg0i15_format.opcode == break_op &&
|
||||
inst.reg0i15_format.immediate == 0x0) {
|
||||
/* break 0x0 */
|
||||
insn->type = INSN_TRAP;
|
||||
} else if (inst.reg0i15_format.opcode == break_op &&
|
||||
inst.reg0i15_format.immediate == 0x1) {
|
||||
/* break 0x1 */
|
||||
insn->type = INSN_BUG;
|
||||
} else if (inst.reg2_format.opcode == ertn_op) {
|
||||
/* ertn */
|
||||
|
||||
Reference in new issue
Block a user