Commit c7a65e06 authored by Quentin Casasnovas's avatar Quentin Casasnovas Committed by Rusty Russell

modpost: mismatch_handler: retrieve tosym information only when needed.

Signed-off-by: default avatarQuentin Casasnovas <quentin.casasnovas@oracle.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 356ad538
...@@ -1432,16 +1432,17 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, ...@@ -1432,16 +1432,17 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
const char *tosym; const char *tosym;
const char *fromsym; const char *fromsym;
tosec = sec_name(elf, get_secindex(elf, sym));
from = find_elf_symbol2(elf, r->r_offset, fromsec); from = find_elf_symbol2(elf, r->r_offset, fromsec);
fromsym = sym_name(elf, from); fromsym = sym_name(elf, from);
to = find_elf_symbol(elf, r->r_addend, sym);
tosym = sym_name(elf, to);
if (!strncmp(fromsym, "reference___initcall", if (!strncmp(fromsym, "reference___initcall",
sizeof("reference___initcall")-1)) sizeof("reference___initcall")-1))
return; return;
tosec = sec_name(elf, get_secindex(elf, sym));
to = find_elf_symbol(elf, r->r_addend, sym);
tosym = sym_name(elf, to);
/* check whitelist - we may ignore it */ /* check whitelist - we may ignore it */
if (secref_whitelist(mismatch, if (secref_whitelist(mismatch,
fromsec, fromsym, tosec, tosym)) { fromsec, fromsym, tosec, tosym)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment