mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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>
This commit is contained in:
parent
356ad53812
commit
c7a65e0645
1 changed files with 4 additions and 3 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue