Skip to content

Commit 31336ed

Browse files
committed
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fixes from Thomas Gleixner: "Three fixlets for objtool: - Address two segfaults related to missing parameter and clang objects - Make it compile clean with clang" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Fix seg fault with clang-compiled objects objtool: Fix seg fault caused by missing parameter objtool: Fix Clang enum conversion warning
2 parents 8371e5a + ce90aaf commit 31336ed

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tools/objtool/arch/x86/decode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
138138
*type = INSN_STACK;
139139
op->src.type = OP_SRC_ADD;
140140
op->src.reg = op_to_cfi_reg[modrm_reg][rex_r];
141-
op->dest.type = OP_SRC_REG;
141+
op->dest.type = OP_DEST_REG;
142142
op->dest.reg = CFI_SP;
143143
}
144144
break;

tools/objtool/builtin-orc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ int cmd_orc(int argc, const char **argv)
4444
const char *objname;
4545

4646
argc--; argv++;
47+
if (argc <= 0)
48+
usage_with_options(orc_usage, check_options);
49+
4750
if (!strncmp(argv[0], "gen", 3)) {
4851
argc = parse_options(argc, argv, check_options, orc_usage, 0);
4952
if (argc != 1)
@@ -52,7 +55,6 @@ int cmd_orc(int argc, const char **argv)
5255
objname = argv[0];
5356

5457
return check(objname, no_fp, no_unreachable, true);
55-
5658
}
5759

5860
if (!strcmp(argv[0], "dump")) {

tools/objtool/orc_gen.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ int create_orc_sections(struct objtool_file *file)
165165

166166
/* create .orc_unwind_ip and .rela.orc_unwind_ip sections */
167167
sec = elf_create_section(file->elf, ".orc_unwind_ip", sizeof(int), idx);
168+
if (!sec)
169+
return -1;
168170

169171
ip_relasec = elf_create_rela_section(file->elf, sec);
170172
if (!ip_relasec)

0 commit comments

Comments
 (0)