All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Helsley <mhelsley@vmware.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC][PATCH 3/3] objtool: Add support for relocations without addends
Date: Thu, 28 May 2020 09:05:05 -0700	[thread overview]
Message-ID: <20200528160505.GX9040@rlwimi.vmware.com> (raw)
In-Reply-To: <20200528142414.rzk5mvz4nwhsjcwp@treble>

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

      reply	other threads:[~2020-05-28 16:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 16:42 [RFC][PATCH 0/3] objtool: Support implicit addend relocations Matt Helsley
2020-05-27 16:42 ` [RFC][PATCH 1/3] objtool: Rename rela to reloc Matt Helsley
2020-05-28 14:04   ` Josh Poimboeuf
2020-05-28 16:00     ` Matt Helsley
2020-05-27 16:42 ` [RFC][PATCH 2/3] objtool: Find relocation base section using sh_info Matt Helsley
2020-05-28 14:09   ` Josh Poimboeuf
2020-05-28 16:02     ` Matt Helsley
2020-05-28 17:00       ` Josh Poimboeuf
2020-05-28 19:15         ` Matt Helsley
2020-05-27 16:42 ` [RFC][PATCH 3/3] objtool: Add support for relocations without addends Matt Helsley
2020-05-28 14:24   ` Josh Poimboeuf
2020-05-28 16:05     ` Matt Helsley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200528160505.GX9040@rlwimi.vmware.com \
    --to=mhelsley@vmware.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.