diff options
author | Quentin Casasnovas <quentin.casasnovas@oracle.com> | 2015-04-13 07:13:45 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-04-13 07:33:01 -0400 |
commit | c7a65e0645b2d1f8382ce27f4edaf1b4f2e09549 (patch) | |
tree | c2ce6cc793e7cbf010db5093ce97f0e69c19f6a3 /scripts/mod | |
parent | 356ad538128ed9221f7d01199a3a7d080f158a5d (diff) |
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.c | 7 |
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, | |||
1432 | const char *tosym; | 1432 | const char *tosym; |
1433 | const char *fromsym; | 1433 | const char *fromsym; |
1434 | 1434 | ||
1435 | tosec = sec_name(elf, get_secindex(elf, sym)); | ||
1436 | from = find_elf_symbol2(elf, r->r_offset, fromsec); | 1435 | from = find_elf_symbol2(elf, r->r_offset, fromsec); |
1437 | fromsym = sym_name(elf, from); | 1436 | fromsym = sym_name(elf, from); |
1438 | to = find_elf_symbol(elf, r->r_addend, sym); | ||
1439 | tosym = sym_name(elf, to); | ||
1440 | 1437 | ||
1441 | if (!strncmp(fromsym, "reference___initcall", | 1438 | if (!strncmp(fromsym, "reference___initcall", |
1442 | sizeof("reference___initcall")-1)) | 1439 | sizeof("reference___initcall")-1)) |
1443 | return; | 1440 | return; |
1444 | 1441 | ||
1442 | tosec = sec_name(elf, get_secindex(elf, sym)); | ||
1443 | to = find_elf_symbol(elf, r->r_addend, sym); | ||
1444 | tosym = sym_name(elf, to); | ||
1445 | |||
1445 | /* check whitelist - we may ignore it */ | 1446 | /* check whitelist - we may ignore it */ |
1446 | if (secref_whitelist(mismatch, | 1447 | if (secref_whitelist(mismatch, |
1447 | fromsec, fromsym, tosec, tosym)) { | 1448 | fromsec, fromsym, tosec, tosym)) { |