mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 10:10:33 +02:00
modpost: pass 'tosec' down to default_mismatch_handler()
default_mismatch_handler() does not need to compute 'tosec' because it is calculated by the caller. Pass it down to default_mismatch_handler() instead of calling sec_name() twice. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
parent
856567d559
commit
dbf7cc2e4e
1 changed files with 3 additions and 4 deletions
|
|
@ -1203,9 +1203,9 @@ static bool is_executable_section(struct elf_info *elf, unsigned int secndx)
|
||||||
|
|
||||||
static void default_mismatch_handler(const char *modname, struct elf_info *elf,
|
static void default_mismatch_handler(const char *modname, struct elf_info *elf,
|
||||||
const struct sectioncheck* const mismatch,
|
const struct sectioncheck* const mismatch,
|
||||||
Elf_Rela *r, Elf_Sym *sym, const char *fromsec)
|
Elf_Rela *r, Elf_Sym *sym, const char *fromsec,
|
||||||
|
const char *tosec)
|
||||||
{
|
{
|
||||||
const char *tosec;
|
|
||||||
Elf_Sym *to;
|
Elf_Sym *to;
|
||||||
Elf_Sym *from;
|
Elf_Sym *from;
|
||||||
const char *tosym;
|
const char *tosym;
|
||||||
|
|
@ -1214,7 +1214,6 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
|
||||||
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);
|
||||||
|
|
||||||
tosec = sec_name(elf, get_secindex(elf, sym));
|
|
||||||
to = find_elf_symbol(elf, r->r_addend, sym);
|
to = find_elf_symbol(elf, r->r_addend, sym);
|
||||||
tosym = sym_name(elf, to);
|
tosym = sym_name(elf, to);
|
||||||
|
|
||||||
|
|
@ -1276,7 +1275,7 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf,
|
||||||
if (!mismatch)
|
if (!mismatch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default_mismatch_handler(modname, elf, mismatch, r, sym, fromsec);
|
default_mismatch_handler(modname, elf, mismatch, r, sym, fromsec, tosec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int *reloc_location(struct elf_info *elf,
|
static unsigned int *reloc_location(struct elf_info *elf,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue