summaryrefslogtreecommitdiff
path: root/scripts/mod/modpost.h
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-04-05 20:33:51 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2022-05-08 03:16:30 +0900
commit7ce3e410e0188ce7ca65b49c90cff2863d6e232e (patch)
treef9dfcabe1c51ceb9750813a74b611b025256674d /scripts/mod/modpost.h
parentdc6dc3e7a73fc09c9ce773bc23bc2864d4c13284 (diff)
modpost: remove useless export_from_sec()
With commit 1743694eb235 ("modpost: stop symbol preloading for modversion CRC") applied, now export_from_sec() is useless. handle_symbol() is called for every symbol in the ELF. When 'symname' does not start with "__ksymtab", export_from_sec() is called, and the returned value is stored in 'export'. It is used in the last part of handle_symbol(): if (strstarts(symname, "__ksymtab_")) { name = symname + strlen("__ksymtab_"); sym_add_exported(name, mod, export); } 'export' is used only when 'symname' starts with "__ksymtab_". So, the value returned by export_from_sec() is never used. Remove useless export_from_sec(). This makes further cleanups possible. I put the temporary code: export = export_unknown; Otherwise, I would get the compiler warning: warning: 'export' may be used uninitialized in this function [-Wmaybe-uninitialized] This is apparently false positive because if (strstarts(symname, "__ksymtab_") ... is a stronger condition than: if (strstarts(symname, "__ksymtab") Anyway, this part will be cleaned up by the next commit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'scripts/mod/modpost.h')
-rw-r--r--scripts/mod/modpost.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 0c47ff95c0e2..0a940fd2e5c7 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -138,8 +138,6 @@ struct elf_info {
Elf_Shdr *sechdrs;
Elf_Sym *symtab_start;
Elf_Sym *symtab_stop;
- Elf_Section export_sec;
- Elf_Section export_gpl_sec;
char *strtab;
char *modinfo;
unsigned int modinfo_len;