[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200528160505.GX9040@rlwimi.vmware.com>
Date: Thu, 28 May 2020 09:05:05 -0700
From: Matt Helsley <mhelsley@...are.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>
CC: <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [RFC][PATCH 3/3] objtool: Add support for relocations without
addends
On Thu, May 28, 2020 at 09:24:14AM -0500, Josh Poimboeuf wrote:
> On Wed, May 27, 2020 at 09:42:33AM -0700, Matt Helsley wrote:
> > @@ -525,16 +556,8 @@ static int read_relocs(struct elf *elf)
> > return -1;
> > }
> > memset(reloc, 0, sizeof(*reloc));
> > -
> > - if (!gelf_getrela(sec->data, i, &reloc->rela)) {
> > - WARN_ELF("gelf_getrela");
> > + if (read_reloc(sec, i, reloc, &symndx))
> > return -1;
> > - }
>
> I try to avoid function pointers, them being slow and ugly and all.
>
> Since it's just a single call site, I'd rather a direct call. For
> example, call read_reloc(), which has an if-then to decide which
> subfunction to call.
OK, I'll take the function pointers out in favor of switches.
Cheers,
-Matt Helsley
Powered by blists - more mailing lists