[PATCH 0/4] export/modpost: avoid renaming __ksymtab entries for symbol namespaces
From: Matthias Maennich
Date: Thu Oct 10 2019 - 11:16:05 EST
The introduction of the symbol namespace patches changed the way symbols are
named in the ksymtab entries. That caused userland tools to fail (such as
kmod's depmod). As depmod is used as part of the kernel build it was worth
having another look whether this name change can be avoided.
The main purpose of this series is to restore the original ksymtab entry names.
For that to happen and to remove some rough edges around that, the relevant
parts in modpost got a small refactoring as to when and how namespaces are
evaluated and set in the symbol struct.
Eventually, the namespace values can be read from __kstrtabns_ entries and
their corresponding __ksymtab_strings values. That removes the need to carry
the namespace names within the (anyway unique) symbol name entries.
The last patch of this series is adopted from Masahiro [1]. By allowing 'no
namespace' to be represented as empty string, large chunks of
include/linux/export.h could be consolidated. Technically, this last patch is
not absolutely necessary to fix functionality. It addresses concerns about
maintainability and readability. While I strongly suggest sending all of the
patches for 5.4, the last one could possible deferred to the next merge window.
This patch applies to the modules-linus [2] branch.
[1] https://lore.kernel.org/lkml/20190927093603.9140-5-yamada.masahiro@xxxxxxxxxxxxx/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git/log/?h=modules-linus
Cc: Jessica Yu <jeyu@xxxxxxxxxx>
Cc: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Cc: Martijn Coenen <maco@xxxxxxxxxxx>
Cc: Lucas De Marchi <lucas.de.marchi@xxxxxxxxx>
Cc: Shaun Ruffell <sruffell@xxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: linux-kbuild@xxxxxxxxxxxxxxx
Cc: linux-modules@xxxxxxxxxxxxxxx
Matthias Maennich (4):
modpost: delegate updating namespaces to separate function
modpost: make updating the symbol namespace explict
symbol namespaces: revert to previous __ksymtab name scheme
export: avoid code duplication in include/linux/export.h
include/linux/export.h | 97 +++++++++++++-----------------------------
kernel/module.c | 2 +-
scripts/mod/modpost.c | 58 ++++++++++++++++---------
scripts/mod/modpost.h | 1 +
4 files changed, 69 insertions(+), 89 deletions(-)
--
2.23.0.581.g78d2f28ef7-goog