[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.21.2006051115020.10354@pobox.suse.cz>
Date: Fri, 5 Jun 2020 11:17:14 +0200 (CEST)
From: Miroslav Benes <mbenes@...e.cz>
To: Julien Thierry <jthierry@...hat.com>
cc: linux-kernel@...r.kernel.org, jpoimboe@...hat.com,
peterz@...radead.org, mhelsley@...are.com
Subject: Re: [PATCH 4/4] objtool: orc_gen: Move orc_entry out of instruction
structure
Hi,
a nit below...
On Thu, 4 Jun 2020, Julien Thierry wrote:
> One orc_entry is associated with each instruction in the object file,
> but having the orc_entry contained by the instruction structure forces
> architectures not implementing the orc subcommands to provide a dummy
> definition of the orc_entry.
>
> Avoid that by having orc_entries in a separate list, part of the
> objtool_file.
> int create_orc(struct objtool_file *file)
> {
> struct instruction *insn;
>
> for_each_insn(file, insn) {
> - struct orc_entry *orc = &insn->orc;
> struct cfi_reg *cfa = &insn->cfi.cfa;
> struct cfi_reg *bp = &insn->cfi.regs[CFI_BP];
> + struct orc_entry *orc;
> + struct orc_data *od;
> +
> + if (!insn->sec->text)
> + continue;
You have the same check added by the previous check a couple of lines
below.
> + od = calloc(1, sizeof(*od));
> + if (!od)
> + return -1;
> + od->insn = insn;
> + list_add_tail(&od->list, &file->orc_data_list);
> +
> + orc = &od->orc;
>
> if (!insn->sec->text)
> continue;
Here.
The rest looks good to me, but I should probably check again with a
clearer head.
Overall, the patch set is a nice improvement.
Miroslav
Powered by blists - more mailing lists