lkml.org 
[lkml]   [2020]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 3/3] objtool: Add support for relocations without addends
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.

--
Josh

\
 
 \ /
  Last update: 2020-05-28 16:25    [W:0.077 / U:1.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site