Re: [PATCH v2 2/2] objtool: remove redundant len value from struct section

From: Joe Lawrence
Date: Sat Aug 21 2021 - 21:18:01 EST


On 8/20/21 3:44 PM, Joe Lawrence wrote:
> [ ... snip ... ]
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> [ ... snip ... ]
> @@ -307,8 +307,9 @@ static int decode_instructions(struct objtool_file *file)
> insn->offset = offset;
>
> ret = arch_decode_instruction(file->elf, sec, offset,
> - sec->len - offset,
> - &insn->len, &insn->type,
> + sec->sh.sh_size - offset,
> + &insn->sec->sh.sh_size,
> + &insn->type,
> &insn->immediate,
> &insn->stack_ops);
> if (ret)

Nack! Not sure what I was thinking here. It was Friday afternoon, so I
probably wans't.

Changing insn->len to insn->sec->sh.sh_size is obviously bogus. I'll
correct this part of the patch, do better testing and post v3 on Monday.

Thanks to Andy for reporting.
--
Joe