summaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorQuentin Casasnovas <quentin.casasnovas@oracle.com>2015-04-13 14:13:45 +0300
committerRusty Russell <rusty@rustcorp.com.au>2015-04-13 14:33:01 +0300
commitc7a65e0645b2d1f8382ce27f4edaf1b4f2e09549 (patch)
treec2ce6cc793e7cbf010db5093ce97f0e69c19f6a3 /scripts/mod
parent356ad538128ed9221f7d01199a3a7d080f158a5d (diff)
downloadlinux-c7a65e0645b2d1f8382ce27f4edaf1b4f2e09549.tar.xz
modpost: mismatch_handler: retrieve tosym information only when needed.
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index c69681e815b2..bf0cf8173beb 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1432,16 +1432,17 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
const char *tosym;
const char *fromsym;
- tosec = sec_name(elf, get_secindex(elf, sym));
from = find_elf_symbol2(elf, r->r_offset, fromsec);
fromsym = sym_name(elf, from);
- to = find_elf_symbol(elf, r->r_addend, sym);
- tosym = sym_name(elf, to);
if (!strncmp(fromsym, "reference___initcall",
sizeof("reference___initcall")-1))
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 */
if (secref_whitelist(mismatch,
fromsec, fromsym, tosec, tosym)) {