From: Ingo Molnar Date: Mon, 12 Apr 2021 08:27:12 +0000 (+0200) Subject: Merge branch 'objtool/core' X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9fbaf1f28df6bfe06e39efd2957908c1ecf19938;p=users%2Fjedix%2Flinux-maple.git Merge branch 'objtool/core' Conflicts: tools/objtool/arch/x86/decode.c --- 9fbaf1f28df6bfe06e39efd2957908c1ecf19938 diff --cc tools/objtool/arch/x86/decode.c index 7e8b5bedd946,431bafb881d4..cedf3ede7545 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@@ -19,19 -16,7 +19,8 @@@ #include #include #include +#include - static unsigned char op_to_cfi_reg[][2] = { - {CFI_AX, CFI_R8}, - {CFI_CX, CFI_R9}, - {CFI_DX, CFI_R10}, - {CFI_BX, CFI_R11}, - {CFI_SP, CFI_R12}, - {CFI_BP, CFI_R13}, - {CFI_SI, CFI_R14}, - {CFI_DI, CFI_R15}, - }; - static int is_x86_64(const struct elf *elf) { switch (elf->ehdr.e_machine) { @@@ -94,12 -104,14 +108,14 @@@ int arch_decode_instruction(const struc struct list_head *ops_list) { struct insn insn; - int x86_64, sign, ret; - unsigned char op1, op2, rex = 0, rex_b = 0, rex_r = 0, rex_w = 0, - rex_x = 0, modrm = 0, modrm_mod = 0, modrm_rm = 0, - modrm_reg = 0, sib = 0; - int x86_64; ++ int x86_64, ret; + unsigned char op1, op2, + rex = 0, rex_b = 0, rex_r = 0, rex_w = 0, rex_x = 0, + modrm = 0, modrm_mod = 0, modrm_rm = 0, modrm_reg = 0, + sib = 0, /* sib_scale = 0, */ sib_index = 0, sib_base = 0; struct stack_op *op = NULL; struct symbol *sym; + u64 imm; x86_64 = is_x86_64(elf); if (x86_64 == -1) diff --cc tools/objtool/check.c index 1f4154f9b04b,a0f762a15ad5..a0a8ce61cd4d --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@@ -2449,12 -2422,9 +2432,12 @@@ static int handle_insn_ops(struct instr list_for_each_entry(op, &insn->stack_ops, list) { - if (update_cfi_state(insn, &state->cfi, op)) + if (update_cfi_state(insn, next_insn, &state->cfi, op)) return 1; + if (!insn->alt_group) + continue; + if (op->dest.type == OP_DEST_PUSHF) { if (!state->uaccess_stack) { state->uaccess_stack = 1; diff --cc tools/objtool/objtool.c index 3a3ea1b4e4da,43c1836a06b4..e21db8bce493 --- a/tools/objtool/objtool.c +++ b/tools/objtool/objtool.c @@@ -59,9 -118,13 +118,14 @@@ struct objtool_file *objtool_open_read( if (!file.elf) return NULL; + if (backup && !objtool_create_backup(objname)) { + WARN("can't create backup file"); + return NULL; + } + INIT_LIST_HEAD(&file.insn_list); hash_init(file.insn_hash); + INIT_LIST_HEAD(&file.retpoline_call_list); INIT_LIST_HEAD(&file.static_call_list); INIT_LIST_HEAD(&file.mcount_loc_list); file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment");