All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jessica Yu <jeyu@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Frederic Barrat <fbarrat@linux.ibm.com>,
	Andrew Donnellan <ajd@linux.ibm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
	Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 13/13] module: remove EXPORY_UNUSED_SYMBOL*
Date: Wed, 27 Jan 2021 14:49:38 +0100	[thread overview]
Message-ID: <YBFvcmUiHRjkucbf@gunter> (raw)
In-Reply-To: <20210121074959.313333-14-hch@lst.de>

+++ Christoph Hellwig [21/01/21 08:49 +0100]:
>EXPORT_UNUSED_SYMBOL* is not actually used anywhere.  Remove the
>unused functionality as we generally just remove unused code anyway.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> arch/arm/configs/bcm2835_defconfig          |  1 -
> arch/arm/configs/mxs_defconfig              |  1 -
> arch/mips/configs/nlm_xlp_defconfig         |  1 -
> arch/mips/configs/nlm_xlr_defconfig         |  1 -
> arch/parisc/configs/generic-32bit_defconfig |  1 -
> arch/parisc/configs/generic-64bit_defconfig |  1 -
> arch/powerpc/configs/ppc6xx_defconfig       |  1 -
> arch/s390/configs/debug_defconfig           |  1 -
> arch/s390/configs/defconfig                 |  1 -
> arch/sh/configs/edosk7760_defconfig         |  1 -
> arch/sh/configs/sdk7780_defconfig           |  1 -
> arch/x86/configs/i386_defconfig             |  1 -
> arch/x86/configs/x86_64_defconfig           |  1 -
> arch/x86/tools/relocs.c                     |  4 +-
> include/asm-generic/vmlinux.lds.h           | 28 ---------
> include/linux/export.h                      |  8 ---
> include/linux/module.h                      | 13 ----
> init/Kconfig                                | 17 -----
> kernel/module.c                             | 69 ++-------------------
> scripts/checkpatch.pl                       |  6 +-
> scripts/mod/modpost.c                       | 39 +-----------
> scripts/mod/modpost.h                       |  2 -
> scripts/module.lds.S                        |  4 --
> tools/include/linux/export.h                |  2 -
> 24 files changed, 13 insertions(+), 192 deletions(-)
>
>diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
>index 44ff9cd88d8161..d6c6c2e031c43a 100644
>--- a/arch/arm/configs/bcm2835_defconfig
>+++ b/arch/arm/configs/bcm2835_defconfig
>@@ -177,7 +177,6 @@ CONFIG_BOOT_PRINTK_DELAY=y
> CONFIG_DYNAMIC_DEBUG=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_LOCKUP_DETECTOR=y
> CONFIG_SCHED_TRACER=y
>diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
>index a9c6f32a9b1c9d..ca32446b187f5d 100644
>--- a/arch/arm/configs/mxs_defconfig
>+++ b/arch/arm/configs/mxs_defconfig
>@@ -164,7 +164,6 @@ CONFIG_FONTS=y
> CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> CONFIG_FRAME_WARN=2048
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_SOFTLOCKUP_DETECTOR=y
>diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
>index 72a211d2d556fd..32c29061172325 100644
>--- a/arch/mips/configs/nlm_xlp_defconfig
>+++ b/arch/mips/configs/nlm_xlp_defconfig
>@@ -549,7 +549,6 @@ CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_FRAME_WARN=1024
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_SCHEDSTATS=y
>diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
>index 4ecb157e56d427..bf9b9244929ecd 100644
>--- a/arch/mips/configs/nlm_xlr_defconfig
>+++ b/arch/mips/configs/nlm_xlr_defconfig
>@@ -500,7 +500,6 @@ CONFIG_CRC7=m
> CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_SCHEDSTATS=y
>diff --git a/arch/parisc/configs/generic-32bit_defconfig b/arch/parisc/configs/generic-32bit_defconfig
>index 3cbcfad5f7249d..7611d48c599e01 100644
>--- a/arch/parisc/configs/generic-32bit_defconfig
>+++ b/arch/parisc/configs/generic-32bit_defconfig
>@@ -22,7 +22,6 @@ CONFIG_PCI_LBA=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-CONFIG_UNUSED_SYMBOLS=y
> # CONFIG_BLK_DEV_BSG is not set
> # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
> CONFIG_BINFMT_MISC=m
>diff --git a/arch/parisc/configs/generic-64bit_defconfig b/arch/parisc/configs/generic-64bit_defconfig
>index 8f81fcbf04c413..53054b81461a10 100644
>--- a/arch/parisc/configs/generic-64bit_defconfig
>+++ b/arch/parisc/configs/generic-64bit_defconfig
>@@ -31,7 +31,6 @@ CONFIG_MODULE_FORCE_LOAD=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_INTEGRITY=y
> CONFIG_BINFMT_MISC=m
> # CONFIG_COMPACTION is not set
>diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
>index ef09f3cce1fa85..34c3859040f9f7 100644
>--- a/arch/powerpc/configs/ppc6xx_defconfig
>+++ b/arch/powerpc/configs/ppc6xx_defconfig
>@@ -1072,7 +1072,6 @@ CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> CONFIG_NLS_KOI8_U=m
> CONFIG_DEBUG_INFO=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_HEADERS_INSTALL=y
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
>diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
>index c4f6ff98a612cd..58e54d17e3154b 100644
>--- a/arch/s390/configs/debug_defconfig
>+++ b/arch/s390/configs/debug_defconfig
>@@ -71,7 +71,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG_SHA256=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_INTEGRITY=y
> CONFIG_BLK_DEV_THROTTLING=y
> CONFIG_BLK_WBT=y
>diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
>index 51135893cffe34..b5e62c0d3e23e0 100644
>--- a/arch/s390/configs/defconfig
>+++ b/arch/s390/configs/defconfig
>@@ -66,7 +66,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG_SHA256=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_THROTTLING=y
> CONFIG_BLK_WBT=y
> CONFIG_BLK_CGROUP_IOLATENCY=y
>diff --git a/arch/sh/configs/edosk7760_defconfig b/arch/sh/configs/edosk7760_defconfig
>index 02ba622985769d..d77f54e906fd04 100644
>--- a/arch/sh/configs/edosk7760_defconfig
>+++ b/arch/sh/configs/edosk7760_defconfig
>@@ -102,7 +102,6 @@ CONFIG_NLS_UTF8=y
> CONFIG_PRINTK_TIME=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_MAGIC_SYSRQ=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DEBUG_SHIRQ=y
> CONFIG_DETECT_HUNG_TASK=y
>diff --git a/arch/sh/configs/sdk7780_defconfig b/arch/sh/configs/sdk7780_defconfig
>index d10a0414123a51..d53c4595fb2e98 100644
>--- a/arch/sh/configs/sdk7780_defconfig
>+++ b/arch/sh/configs/sdk7780_defconfig
>@@ -130,7 +130,6 @@ CONFIG_NLS_ISO8859_15=y
> CONFIG_NLS_UTF8=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_MAGIC_SYSRQ=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DETECT_HUNG_TASK=y
> # CONFIG_SCHED_DEBUG is not set
>diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
>index 78210793d357cf..9c9c4a888b1dbf 100644
>--- a/arch/x86/configs/i386_defconfig
>+++ b/arch/x86/configs/i386_defconfig
>@@ -50,7 +50,6 @@ CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-# CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
>diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
>index 9936528e19393a..b60bd2d8603499 100644
>--- a/arch/x86/configs/x86_64_defconfig
>+++ b/arch/x86/configs/x86_64_defconfig
>@@ -48,7 +48,6 @@ CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-# CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
>diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
>index 0d210d0e83e241..b9c577a3cacca6 100644
>--- a/arch/x86/tools/relocs.c
>+++ b/arch/x86/tools/relocs.c
>@@ -61,8 +61,8 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
> 	"(__iommu_table|__apicdrivers|__smp_locks)(|_end)|"
> 	"__(start|end)_pci_.*|"
> 	"__(start|end)_builtin_fw|"
>-	"__(start|stop)___ksymtab(|_gpl|_unused|_unused_gpl)|"
>-	"__(start|stop)___kcrctab(|_gpl|_unused|_unused_gpl)|"
>+	"__(start|stop)___ksymtab(|_gpl)|"
>+	"__(start|stop)___kcrctab(|_gpl)|"
> 	"__(start|stop)___param|"
> 	"__(start|stop)___modver|"
> 	"__(start|stop)___bug_table|"
>diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
>index 83243506e68b00..1fa338ac6a5477 100644
>--- a/include/asm-generic/vmlinux.lds.h
>+++ b/include/asm-generic/vmlinux.lds.h
>@@ -481,20 +481,6 @@
> 		__stop___ksymtab_gpl = .;				\
> 	}								\
> 									\
>-	/* Kernel symbol table: Normal unused symbols */		\
>-	__ksymtab_unused  : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) {	\
>-		__start___ksymtab_unused = .;				\
>-		KEEP(*(SORT(___ksymtab_unused+*)))			\
>-		__stop___ksymtab_unused = .;				\
>-	}								\
>-									\
>-	/* Kernel symbol table: GPL-only unused symbols */		\
>-	__ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
>-		__start___ksymtab_unused_gpl = .;			\
>-		KEEP(*(SORT(___ksymtab_unused_gpl+*)))			\
>-		__stop___ksymtab_unused_gpl = .;			\
>-	}								\
>-									\
> 	/* Kernel symbol table: Normal symbols */			\
> 	__kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {		\
> 		__start___kcrctab = .;					\
>@@ -509,20 +495,6 @@
> 		__stop___kcrctab_gpl = .;				\
> 	}								\
> 									\
>-	/* Kernel symbol table: Normal unused symbols */		\
>-	__kcrctab_unused  : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) {	\
>-		__start___kcrctab_unused = .;				\
>-		KEEP(*(SORT(___kcrctab_unused+*)))			\
>-		__stop___kcrctab_unused = .;				\
>-	}								\
>-									\
>-	/* Kernel symbol table: GPL-only unused symbols */		\
>-	__kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
>-		__start___kcrctab_unused_gpl = .;			\
>-		KEEP(*(SORT(___kcrctab_unused_gpl+*)))			\
>-		__stop___kcrctab_unused_gpl = .;			\
>-	}								\
>-									\
> 	/* Kernel symbol table: strings */				\
>         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {	\
> 		*(__ksymtab_strings)					\
>diff --git a/include/linux/export.h b/include/linux/export.h
>index 362b64f8d4a7c2..6271a5d9c988fa 100644
>--- a/include/linux/export.h
>+++ b/include/linux/export.h
>@@ -160,14 +160,6 @@ struct kernel_symbol {
> #define EXPORT_SYMBOL_NS(sym, ns)	__EXPORT_SYMBOL(sym, "", #ns)
> #define EXPORT_SYMBOL_NS_GPL(sym, ns)	__EXPORT_SYMBOL(sym, "_gpl", #ns)
>
>-#ifdef CONFIG_UNUSED_SYMBOLS
>-#define EXPORT_UNUSED_SYMBOL(sym)	_EXPORT_SYMBOL(sym, "_unused")
>-#define EXPORT_UNUSED_SYMBOL_GPL(sym)	_EXPORT_SYMBOL(sym, "_unused_gpl")
>-#else
>-#define EXPORT_UNUSED_SYMBOL(sym)
>-#define EXPORT_UNUSED_SYMBOL_GPL(sym)
>-#endif
>-
> #endif /* !__ASSEMBLY__ */
>
> #endif /* _LINUX_EXPORT_H */
>diff --git a/include/linux/module.h b/include/linux/module.h
>index 8f4d577d4707c2..0e70596c9a704a 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -392,18 +392,6 @@ struct module {
> 	const s32 *gpl_crcs;
> 	bool using_gplonly_symbols;
>
>-#ifdef CONFIG_UNUSED_SYMBOLS
>-	/* unused exported symbols. */
>-	const struct kernel_symbol *unused_syms;
>-	const s32 *unused_crcs;
>-	unsigned int num_unused_syms;
>-
>-	/* GPL-only, unused exported symbols. */
>-	unsigned int num_unused_gpl_syms;
>-	const struct kernel_symbol *unused_gpl_syms;
>-	const s32 *unused_gpl_crcs;
>-#endif
>-
> #ifdef CONFIG_MODULE_SIG
> 	/* Signature was verified. */
> 	bool sig_ok;
>@@ -592,7 +580,6 @@ struct symsearch {
> 		GPL_ONLY,
> 		WILL_BE_GPL_ONLY,
> 	} license;
>-	bool unused;
> };

Thanks for the cleanups. While we're here, I noticed that struct
symsearch is only used internally in kernel/module.c, so I don't think
it actually needs to be in include/linux/module.h. I don't see it used
anywhere else. We could move maybe that to kernel/module-internal.h.


WARNING: multiple messages have this Message-ID
From: Jessica Yu <jeyu@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Andrew Donnellan <ajd@linux.ibm.com>,
	linux-kbuild@vger.kernel.org, David Airlie <airlied@linux.ie>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Jiri Kosina <jikos@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	linux-kernel@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
	live-patching@vger.kernel.org,
	Michal Marek <michal.lkml@markovi.net>,
	dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Frederic Barrat <fbarrat@linux.ibm.com>,
	Daniel Vetter <daniel@ffwll.ch>, Miroslav Benes <mbenes@suse.cz>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 13/13] module: remove EXPORY_UNUSED_SYMBOL*
Date: Wed, 27 Jan 2021 14:49:38 +0100	[thread overview]
Message-ID: <YBFvcmUiHRjkucbf@gunter> (raw)
In-Reply-To: <20210121074959.313333-14-hch@lst.de>

+++ Christoph Hellwig [21/01/21 08:49 +0100]:
>EXPORT_UNUSED_SYMBOL* is not actually used anywhere.  Remove the
>unused functionality as we generally just remove unused code anyway.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> arch/arm/configs/bcm2835_defconfig          |  1 -
> arch/arm/configs/mxs_defconfig              |  1 -
> arch/mips/configs/nlm_xlp_defconfig         |  1 -
> arch/mips/configs/nlm_xlr_defconfig         |  1 -
> arch/parisc/configs/generic-32bit_defconfig |  1 -
> arch/parisc/configs/generic-64bit_defconfig |  1 -
> arch/powerpc/configs/ppc6xx_defconfig       |  1 -
> arch/s390/configs/debug_defconfig           |  1 -
> arch/s390/configs/defconfig                 |  1 -
> arch/sh/configs/edosk7760_defconfig         |  1 -
> arch/sh/configs/sdk7780_defconfig           |  1 -
> arch/x86/configs/i386_defconfig             |  1 -
> arch/x86/configs/x86_64_defconfig           |  1 -
> arch/x86/tools/relocs.c                     |  4 +-
> include/asm-generic/vmlinux.lds.h           | 28 ---------
> include/linux/export.h                      |  8 ---
> include/linux/module.h                      | 13 ----
> init/Kconfig                                | 17 -----
> kernel/module.c                             | 69 ++-------------------
> scripts/checkpatch.pl                       |  6 +-
> scripts/mod/modpost.c                       | 39 +-----------
> scripts/mod/modpost.h                       |  2 -
> scripts/module.lds.S                        |  4 --
> tools/include/linux/export.h                |  2 -
> 24 files changed, 13 insertions(+), 192 deletions(-)
>
>diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
>index 44ff9cd88d8161..d6c6c2e031c43a 100644
>--- a/arch/arm/configs/bcm2835_defconfig
>+++ b/arch/arm/configs/bcm2835_defconfig
>@@ -177,7 +177,6 @@ CONFIG_BOOT_PRINTK_DELAY=y
> CONFIG_DYNAMIC_DEBUG=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_LOCKUP_DETECTOR=y
> CONFIG_SCHED_TRACER=y
>diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
>index a9c6f32a9b1c9d..ca32446b187f5d 100644
>--- a/arch/arm/configs/mxs_defconfig
>+++ b/arch/arm/configs/mxs_defconfig
>@@ -164,7 +164,6 @@ CONFIG_FONTS=y
> CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> CONFIG_FRAME_WARN=2048
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_SOFTLOCKUP_DETECTOR=y
>diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
>index 72a211d2d556fd..32c29061172325 100644
>--- a/arch/mips/configs/nlm_xlp_defconfig
>+++ b/arch/mips/configs/nlm_xlp_defconfig
>@@ -549,7 +549,6 @@ CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_FRAME_WARN=1024
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_SCHEDSTATS=y
>diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
>index 4ecb157e56d427..bf9b9244929ecd 100644
>--- a/arch/mips/configs/nlm_xlr_defconfig
>+++ b/arch/mips/configs/nlm_xlr_defconfig
>@@ -500,7 +500,6 @@ CONFIG_CRC7=m
> CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_SCHEDSTATS=y
>diff --git a/arch/parisc/configs/generic-32bit_defconfig b/arch/parisc/configs/generic-32bit_defconfig
>index 3cbcfad5f7249d..7611d48c599e01 100644
>--- a/arch/parisc/configs/generic-32bit_defconfig
>+++ b/arch/parisc/configs/generic-32bit_defconfig
>@@ -22,7 +22,6 @@ CONFIG_PCI_LBA=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-CONFIG_UNUSED_SYMBOLS=y
> # CONFIG_BLK_DEV_BSG is not set
> # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
> CONFIG_BINFMT_MISC=m
>diff --git a/arch/parisc/configs/generic-64bit_defconfig b/arch/parisc/configs/generic-64bit_defconfig
>index 8f81fcbf04c413..53054b81461a10 100644
>--- a/arch/parisc/configs/generic-64bit_defconfig
>+++ b/arch/parisc/configs/generic-64bit_defconfig
>@@ -31,7 +31,6 @@ CONFIG_MODULE_FORCE_LOAD=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_INTEGRITY=y
> CONFIG_BINFMT_MISC=m
> # CONFIG_COMPACTION is not set
>diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
>index ef09f3cce1fa85..34c3859040f9f7 100644
>--- a/arch/powerpc/configs/ppc6xx_defconfig
>+++ b/arch/powerpc/configs/ppc6xx_defconfig
>@@ -1072,7 +1072,6 @@ CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> CONFIG_NLS_KOI8_U=m
> CONFIG_DEBUG_INFO=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_HEADERS_INSTALL=y
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
>diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
>index c4f6ff98a612cd..58e54d17e3154b 100644
>--- a/arch/s390/configs/debug_defconfig
>+++ b/arch/s390/configs/debug_defconfig
>@@ -71,7 +71,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG_SHA256=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_INTEGRITY=y
> CONFIG_BLK_DEV_THROTTLING=y
> CONFIG_BLK_WBT=y
>diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
>index 51135893cffe34..b5e62c0d3e23e0 100644
>--- a/arch/s390/configs/defconfig
>+++ b/arch/s390/configs/defconfig
>@@ -66,7 +66,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG_SHA256=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_THROTTLING=y
> CONFIG_BLK_WBT=y
> CONFIG_BLK_CGROUP_IOLATENCY=y
>diff --git a/arch/sh/configs/edosk7760_defconfig b/arch/sh/configs/edosk7760_defconfig
>index 02ba622985769d..d77f54e906fd04 100644
>--- a/arch/sh/configs/edosk7760_defconfig
>+++ b/arch/sh/configs/edosk7760_defconfig
>@@ -102,7 +102,6 @@ CONFIG_NLS_UTF8=y
> CONFIG_PRINTK_TIME=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_MAGIC_SYSRQ=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DEBUG_SHIRQ=y
> CONFIG_DETECT_HUNG_TASK=y
>diff --git a/arch/sh/configs/sdk7780_defconfig b/arch/sh/configs/sdk7780_defconfig
>index d10a0414123a51..d53c4595fb2e98 100644
>--- a/arch/sh/configs/sdk7780_defconfig
>+++ b/arch/sh/configs/sdk7780_defconfig
>@@ -130,7 +130,6 @@ CONFIG_NLS_ISO8859_15=y
> CONFIG_NLS_UTF8=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_MAGIC_SYSRQ=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DETECT_HUNG_TASK=y
> # CONFIG_SCHED_DEBUG is not set
>diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
>index 78210793d357cf..9c9c4a888b1dbf 100644
>--- a/arch/x86/configs/i386_defconfig
>+++ b/arch/x86/configs/i386_defconfig
>@@ -50,7 +50,6 @@ CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-# CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
>diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
>index 9936528e19393a..b60bd2d8603499 100644
>--- a/arch/x86/configs/x86_64_defconfig
>+++ b/arch/x86/configs/x86_64_defconfig
>@@ -48,7 +48,6 @@ CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-# CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
>diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
>index 0d210d0e83e241..b9c577a3cacca6 100644
>--- a/arch/x86/tools/relocs.c
>+++ b/arch/x86/tools/relocs.c
>@@ -61,8 +61,8 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
> 	"(__iommu_table|__apicdrivers|__smp_locks)(|_end)|"
> 	"__(start|end)_pci_.*|"
> 	"__(start|end)_builtin_fw|"
>-	"__(start|stop)___ksymtab(|_gpl|_unused|_unused_gpl)|"
>-	"__(start|stop)___kcrctab(|_gpl|_unused|_unused_gpl)|"
>+	"__(start|stop)___ksymtab(|_gpl)|"
>+	"__(start|stop)___kcrctab(|_gpl)|"
> 	"__(start|stop)___param|"
> 	"__(start|stop)___modver|"
> 	"__(start|stop)___bug_table|"
>diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
>index 83243506e68b00..1fa338ac6a5477 100644
>--- a/include/asm-generic/vmlinux.lds.h
>+++ b/include/asm-generic/vmlinux.lds.h
>@@ -481,20 +481,6 @@
> 		__stop___ksymtab_gpl = .;				\
> 	}								\
> 									\
>-	/* Kernel symbol table: Normal unused symbols */		\
>-	__ksymtab_unused  : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) {	\
>-		__start___ksymtab_unused = .;				\
>-		KEEP(*(SORT(___ksymtab_unused+*)))			\
>-		__stop___ksymtab_unused = .;				\
>-	}								\
>-									\
>-	/* Kernel symbol table: GPL-only unused symbols */		\
>-	__ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
>-		__start___ksymtab_unused_gpl = .;			\
>-		KEEP(*(SORT(___ksymtab_unused_gpl+*)))			\
>-		__stop___ksymtab_unused_gpl = .;			\
>-	}								\
>-									\
> 	/* Kernel symbol table: Normal symbols */			\
> 	__kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {		\
> 		__start___kcrctab = .;					\
>@@ -509,20 +495,6 @@
> 		__stop___kcrctab_gpl = .;				\
> 	}								\
> 									\
>-	/* Kernel symbol table: Normal unused symbols */		\
>-	__kcrctab_unused  : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) {	\
>-		__start___kcrctab_unused = .;				\
>-		KEEP(*(SORT(___kcrctab_unused+*)))			\
>-		__stop___kcrctab_unused = .;				\
>-	}								\
>-									\
>-	/* Kernel symbol table: GPL-only unused symbols */		\
>-	__kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
>-		__start___kcrctab_unused_gpl = .;			\
>-		KEEP(*(SORT(___kcrctab_unused_gpl+*)))			\
>-		__stop___kcrctab_unused_gpl = .;			\
>-	}								\
>-									\
> 	/* Kernel symbol table: strings */				\
>         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {	\
> 		*(__ksymtab_strings)					\
>diff --git a/include/linux/export.h b/include/linux/export.h
>index 362b64f8d4a7c2..6271a5d9c988fa 100644
>--- a/include/linux/export.h
>+++ b/include/linux/export.h
>@@ -160,14 +160,6 @@ struct kernel_symbol {
> #define EXPORT_SYMBOL_NS(sym, ns)	__EXPORT_SYMBOL(sym, "", #ns)
> #define EXPORT_SYMBOL_NS_GPL(sym, ns)	__EXPORT_SYMBOL(sym, "_gpl", #ns)
>
>-#ifdef CONFIG_UNUSED_SYMBOLS
>-#define EXPORT_UNUSED_SYMBOL(sym)	_EXPORT_SYMBOL(sym, "_unused")
>-#define EXPORT_UNUSED_SYMBOL_GPL(sym)	_EXPORT_SYMBOL(sym, "_unused_gpl")
>-#else
>-#define EXPORT_UNUSED_SYMBOL(sym)
>-#define EXPORT_UNUSED_SYMBOL_GPL(sym)
>-#endif
>-
> #endif /* !__ASSEMBLY__ */
>
> #endif /* _LINUX_EXPORT_H */
>diff --git a/include/linux/module.h b/include/linux/module.h
>index 8f4d577d4707c2..0e70596c9a704a 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -392,18 +392,6 @@ struct module {
> 	const s32 *gpl_crcs;
> 	bool using_gplonly_symbols;
>
>-#ifdef CONFIG_UNUSED_SYMBOLS
>-	/* unused exported symbols. */
>-	const struct kernel_symbol *unused_syms;
>-	const s32 *unused_crcs;
>-	unsigned int num_unused_syms;
>-
>-	/* GPL-only, unused exported symbols. */
>-	unsigned int num_unused_gpl_syms;
>-	const struct kernel_symbol *unused_gpl_syms;
>-	const s32 *unused_gpl_crcs;
>-#endif
>-
> #ifdef CONFIG_MODULE_SIG
> 	/* Signature was verified. */
> 	bool sig_ok;
>@@ -592,7 +580,6 @@ struct symsearch {
> 		GPL_ONLY,
> 		WILL_BE_GPL_ONLY,
> 	} license;
>-	bool unused;
> };

Thanks for the cleanups. While we're here, I noticed that struct
symsearch is only used internally in kernel/module.c, so I don't think
it actually needs to be in include/linux/module.h. I don't see it used
anywhere else. We could move maybe that to kernel/module-internal.h.


WARNING: multiple messages have this Message-ID
From: Jessica Yu <jeyu@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Andrew Donnellan <ajd@linux.ibm.com>,
	linux-kbuild@vger.kernel.org, David Airlie <airlied@linux.ie>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Jiri Kosina <jikos@kernel.org>,
	linux-kernel@vger.kernel.org, live-patching@vger.kernel.org,
	Michal Marek <michal.lkml@markovi.net>,
	dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Frederic Barrat <fbarrat@linux.ibm.com>,
	Miroslav Benes <mbenes@suse.cz>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 13/13] module: remove EXPORY_UNUSED_SYMBOL*
Date: Wed, 27 Jan 2021 14:49:38 +0100	[thread overview]
Message-ID: <YBFvcmUiHRjkucbf@gunter> (raw)
In-Reply-To: <20210121074959.313333-14-hch@lst.de>

+++ Christoph Hellwig [21/01/21 08:49 +0100]:
>EXPORT_UNUSED_SYMBOL* is not actually used anywhere.  Remove the
>unused functionality as we generally just remove unused code anyway.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> arch/arm/configs/bcm2835_defconfig          |  1 -
> arch/arm/configs/mxs_defconfig              |  1 -
> arch/mips/configs/nlm_xlp_defconfig         |  1 -
> arch/mips/configs/nlm_xlr_defconfig         |  1 -
> arch/parisc/configs/generic-32bit_defconfig |  1 -
> arch/parisc/configs/generic-64bit_defconfig |  1 -
> arch/powerpc/configs/ppc6xx_defconfig       |  1 -
> arch/s390/configs/debug_defconfig           |  1 -
> arch/s390/configs/defconfig                 |  1 -
> arch/sh/configs/edosk7760_defconfig         |  1 -
> arch/sh/configs/sdk7780_defconfig           |  1 -
> arch/x86/configs/i386_defconfig             |  1 -
> arch/x86/configs/x86_64_defconfig           |  1 -
> arch/x86/tools/relocs.c                     |  4 +-
> include/asm-generic/vmlinux.lds.h           | 28 ---------
> include/linux/export.h                      |  8 ---
> include/linux/module.h                      | 13 ----
> init/Kconfig                                | 17 -----
> kernel/module.c                             | 69 ++-------------------
> scripts/checkpatch.pl                       |  6 +-
> scripts/mod/modpost.c                       | 39 +-----------
> scripts/mod/modpost.h                       |  2 -
> scripts/module.lds.S                        |  4 --
> tools/include/linux/export.h                |  2 -
> 24 files changed, 13 insertions(+), 192 deletions(-)
>
>diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
>index 44ff9cd88d8161..d6c6c2e031c43a 100644
>--- a/arch/arm/configs/bcm2835_defconfig
>+++ b/arch/arm/configs/bcm2835_defconfig
>@@ -177,7 +177,6 @@ CONFIG_BOOT_PRINTK_DELAY=y
> CONFIG_DYNAMIC_DEBUG=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_LOCKUP_DETECTOR=y
> CONFIG_SCHED_TRACER=y
>diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
>index a9c6f32a9b1c9d..ca32446b187f5d 100644
>--- a/arch/arm/configs/mxs_defconfig
>+++ b/arch/arm/configs/mxs_defconfig
>@@ -164,7 +164,6 @@ CONFIG_FONTS=y
> CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> CONFIG_FRAME_WARN=2048
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_SOFTLOCKUP_DETECTOR=y
>diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
>index 72a211d2d556fd..32c29061172325 100644
>--- a/arch/mips/configs/nlm_xlp_defconfig
>+++ b/arch/mips/configs/nlm_xlp_defconfig
>@@ -549,7 +549,6 @@ CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_FRAME_WARN=1024
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_SCHEDSTATS=y
>diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
>index 4ecb157e56d427..bf9b9244929ecd 100644
>--- a/arch/mips/configs/nlm_xlr_defconfig
>+++ b/arch/mips/configs/nlm_xlr_defconfig
>@@ -500,7 +500,6 @@ CONFIG_CRC7=m
> CONFIG_PRINTK_TIME=y
> CONFIG_DEBUG_INFO=y
> # CONFIG_ENABLE_MUST_CHECK is not set
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_MEMORY_INIT=y
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_SCHEDSTATS=y
>diff --git a/arch/parisc/configs/generic-32bit_defconfig b/arch/parisc/configs/generic-32bit_defconfig
>index 3cbcfad5f7249d..7611d48c599e01 100644
>--- a/arch/parisc/configs/generic-32bit_defconfig
>+++ b/arch/parisc/configs/generic-32bit_defconfig
>@@ -22,7 +22,6 @@ CONFIG_PCI_LBA=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-CONFIG_UNUSED_SYMBOLS=y
> # CONFIG_BLK_DEV_BSG is not set
> # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
> CONFIG_BINFMT_MISC=m
>diff --git a/arch/parisc/configs/generic-64bit_defconfig b/arch/parisc/configs/generic-64bit_defconfig
>index 8f81fcbf04c413..53054b81461a10 100644
>--- a/arch/parisc/configs/generic-64bit_defconfig
>+++ b/arch/parisc/configs/generic-64bit_defconfig
>@@ -31,7 +31,6 @@ CONFIG_MODULE_FORCE_LOAD=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_INTEGRITY=y
> CONFIG_BINFMT_MISC=m
> # CONFIG_COMPACTION is not set
>diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
>index ef09f3cce1fa85..34c3859040f9f7 100644
>--- a/arch/powerpc/configs/ppc6xx_defconfig
>+++ b/arch/powerpc/configs/ppc6xx_defconfig
>@@ -1072,7 +1072,6 @@ CONFIG_NLS_ISO8859_15=m
> CONFIG_NLS_KOI8_R=m
> CONFIG_NLS_KOI8_U=m
> CONFIG_DEBUG_INFO=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_HEADERS_INSTALL=y
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
>diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
>index c4f6ff98a612cd..58e54d17e3154b 100644
>--- a/arch/s390/configs/debug_defconfig
>+++ b/arch/s390/configs/debug_defconfig
>@@ -71,7 +71,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG_SHA256=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_INTEGRITY=y
> CONFIG_BLK_DEV_THROTTLING=y
> CONFIG_BLK_WBT=y
>diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
>index 51135893cffe34..b5e62c0d3e23e0 100644
>--- a/arch/s390/configs/defconfig
>+++ b/arch/s390/configs/defconfig
>@@ -66,7 +66,6 @@ CONFIG_MODULE_FORCE_UNLOAD=y
> CONFIG_MODVERSIONS=y
> CONFIG_MODULE_SRCVERSION_ALL=y
> CONFIG_MODULE_SIG_SHA256=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_BLK_DEV_THROTTLING=y
> CONFIG_BLK_WBT=y
> CONFIG_BLK_CGROUP_IOLATENCY=y
>diff --git a/arch/sh/configs/edosk7760_defconfig b/arch/sh/configs/edosk7760_defconfig
>index 02ba622985769d..d77f54e906fd04 100644
>--- a/arch/sh/configs/edosk7760_defconfig
>+++ b/arch/sh/configs/edosk7760_defconfig
>@@ -102,7 +102,6 @@ CONFIG_NLS_UTF8=y
> CONFIG_PRINTK_TIME=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_MAGIC_SYSRQ=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DEBUG_SHIRQ=y
> CONFIG_DETECT_HUNG_TASK=y
>diff --git a/arch/sh/configs/sdk7780_defconfig b/arch/sh/configs/sdk7780_defconfig
>index d10a0414123a51..d53c4595fb2e98 100644
>--- a/arch/sh/configs/sdk7780_defconfig
>+++ b/arch/sh/configs/sdk7780_defconfig
>@@ -130,7 +130,6 @@ CONFIG_NLS_ISO8859_15=y
> CONFIG_NLS_UTF8=y
> # CONFIG_ENABLE_MUST_CHECK is not set
> CONFIG_MAGIC_SYSRQ=y
>-CONFIG_UNUSED_SYMBOLS=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DETECT_HUNG_TASK=y
> # CONFIG_SCHED_DEBUG is not set
>diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
>index 78210793d357cf..9c9c4a888b1dbf 100644
>--- a/arch/x86/configs/i386_defconfig
>+++ b/arch/x86/configs/i386_defconfig
>@@ -50,7 +50,6 @@ CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-# CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
>diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
>index 9936528e19393a..b60bd2d8603499 100644
>--- a/arch/x86/configs/x86_64_defconfig
>+++ b/arch/x86/configs/x86_64_defconfig
>@@ -48,7 +48,6 @@ CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
>-# CONFIG_UNUSED_SYMBOLS is not set
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
>diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
>index 0d210d0e83e241..b9c577a3cacca6 100644
>--- a/arch/x86/tools/relocs.c
>+++ b/arch/x86/tools/relocs.c
>@@ -61,8 +61,8 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
> 	"(__iommu_table|__apicdrivers|__smp_locks)(|_end)|"
> 	"__(start|end)_pci_.*|"
> 	"__(start|end)_builtin_fw|"
>-	"__(start|stop)___ksymtab(|_gpl|_unused|_unused_gpl)|"
>-	"__(start|stop)___kcrctab(|_gpl|_unused|_unused_gpl)|"
>+	"__(start|stop)___ksymtab(|_gpl)|"
>+	"__(start|stop)___kcrctab(|_gpl)|"
> 	"__(start|stop)___param|"
> 	"__(start|stop)___modver|"
> 	"__(start|stop)___bug_table|"
>diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
>index 83243506e68b00..1fa338ac6a5477 100644
>--- a/include/asm-generic/vmlinux.lds.h
>+++ b/include/asm-generic/vmlinux.lds.h
>@@ -481,20 +481,6 @@
> 		__stop___ksymtab_gpl = .;				\
> 	}								\
> 									\
>-	/* Kernel symbol table: Normal unused symbols */		\
>-	__ksymtab_unused  : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) {	\
>-		__start___ksymtab_unused = .;				\
>-		KEEP(*(SORT(___ksymtab_unused+*)))			\
>-		__stop___ksymtab_unused = .;				\
>-	}								\
>-									\
>-	/* Kernel symbol table: GPL-only unused symbols */		\
>-	__ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
>-		__start___ksymtab_unused_gpl = .;			\
>-		KEEP(*(SORT(___ksymtab_unused_gpl+*)))			\
>-		__stop___ksymtab_unused_gpl = .;			\
>-	}								\
>-									\
> 	/* Kernel symbol table: Normal symbols */			\
> 	__kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {		\
> 		__start___kcrctab = .;					\
>@@ -509,20 +495,6 @@
> 		__stop___kcrctab_gpl = .;				\
> 	}								\
> 									\
>-	/* Kernel symbol table: Normal unused symbols */		\
>-	__kcrctab_unused  : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) {	\
>-		__start___kcrctab_unused = .;				\
>-		KEEP(*(SORT(___kcrctab_unused+*)))			\
>-		__stop___kcrctab_unused = .;				\
>-	}								\
>-									\
>-	/* Kernel symbol table: GPL-only unused symbols */		\
>-	__kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
>-		__start___kcrctab_unused_gpl = .;			\
>-		KEEP(*(SORT(___kcrctab_unused_gpl+*)))			\
>-		__stop___kcrctab_unused_gpl = .;			\
>-	}								\
>-									\
> 	/* Kernel symbol table: strings */				\
>         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {	\
> 		*(__ksymtab_strings)					\
>diff --git a/include/linux/export.h b/include/linux/export.h
>index 362b64f8d4a7c2..6271a5d9c988fa 100644
>--- a/include/linux/export.h
>+++ b/include/linux/export.h
>@@ -160,14 +160,6 @@ struct kernel_symbol {
> #define EXPORT_SYMBOL_NS(sym, ns)	__EXPORT_SYMBOL(sym, "", #ns)
> #define EXPORT_SYMBOL_NS_GPL(sym, ns)	__EXPORT_SYMBOL(sym, "_gpl", #ns)
>
>-#ifdef CONFIG_UNUSED_SYMBOLS
>-#define EXPORT_UNUSED_SYMBOL(sym)	_EXPORT_SYMBOL(sym, "_unused")
>-#define EXPORT_UNUSED_SYMBOL_GPL(sym)	_EXPORT_SYMBOL(sym, "_unused_gpl")
>-#else
>-#define EXPORT_UNUSED_SYMBOL(sym)
>-#define EXPORT_UNUSED_SYMBOL_GPL(sym)
>-#endif
>-
> #endif /* !__ASSEMBLY__ */
>
> #endif /* _LINUX_EXPORT_H */
>diff --git a/include/linux/module.h b/include/linux/module.h
>index 8f4d577d4707c2..0e70596c9a704a 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -392,18 +392,6 @@ struct module {
> 	const s32 *gpl_crcs;
> 	bool using_gplonly_symbols;
>
>-#ifdef CONFIG_UNUSED_SYMBOLS
>-	/* unused exported symbols. */
>-	const struct kernel_symbol *unused_syms;
>-	const s32 *unused_crcs;
>-	unsigned int num_unused_syms;
>-
>-	/* GPL-only, unused exported symbols. */
>-	unsigned int num_unused_gpl_syms;
>-	const struct kernel_symbol *unused_gpl_syms;
>-	const s32 *unused_gpl_crcs;
>-#endif
>-
> #ifdef CONFIG_MODULE_SIG
> 	/* Signature was verified. */
> 	bool sig_ok;
>@@ -592,7 +580,6 @@ struct symsearch {
> 		GPL_ONLY,
> 		WILL_BE_GPL_ONLY,
> 	} license;
>-	bool unused;
> };

Thanks for the cleanups. While we're here, I noticed that struct
symsearch is only used internally in kernel/module.c, so I don't think
it actually needs to be in include/linux/module.h. I don't see it used
anywhere else. We could move maybe that to kernel/module-internal.h.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-01-27 13:52 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  7:49 module loader dead code removal and cleanusp Christoph Hellwig
2021-01-21  7:49 ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 01/13] powerpc/powernv: remove get_cxl_module Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  9:09   ` Andrew Donnellan
2021-01-21  9:09     ` Andrew Donnellan
2021-01-21  9:09     ` Andrew Donnellan
2021-01-21  7:49 ` [PATCH 02/13] module: add a module_loaded helper Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  9:59   ` Christophe Leroy
2021-01-21 10:13     ` David Laight
2021-01-21 10:17       ` Christophe Leroy
2021-01-21 10:00   ` Christophe Leroy
2021-01-21 10:00     ` Christophe Leroy
2021-01-21 17:11     ` Christoph Hellwig
2021-01-21 17:11       ` Christoph Hellwig
2021-01-21 17:44       ` David Laight
2021-01-21 17:44         ` David Laight
2021-01-21 17:44         ` David Laight
2021-01-21  7:49 ` [PATCH 03/13] livepatch: refactor klp_init_object Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-27 12:58   ` Petr Mladek
2021-01-27 12:58     ` Petr Mladek
2021-01-27 12:58     ` Petr Mladek
2021-01-28 16:22     ` Christoph Hellwig
2021-01-28 16:22       ` Christoph Hellwig
2021-01-28 16:24       ` Christoph Hellwig
2021-01-28 16:24         ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 04/13] livepatch: move klp_find_object_module to module.c Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21 21:45   ` Josh Poimboeuf
2021-01-21 21:45     ` Josh Poimboeuf
2021-01-21 21:45     ` Josh Poimboeuf
2021-01-26 14:25   ` Jessica Yu
2021-01-26 14:25     ` Jessica Yu
2021-01-26 14:25     ` Jessica Yu
2021-01-27 11:55     ` Petr Mladek
2021-01-27 11:55       ` Petr Mladek
2021-01-27 11:55       ` Petr Mladek
2021-01-21  7:49 ` [PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 06/13] kallsyms: only build {,module_}kallsyms_on_each_symbol when required Christoph Hellwig
2021-01-21  7:49   ` [PATCH 06/13] kallsyms: only build {, module_}kallsyms_on_each_symbol " Christoph Hellwig
2021-01-21  7:49 ` [PATCH 07/13] module: mark module_mutex static Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 08/13] drm: remove drm_fb_helper_modinit Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  8:25   ` Daniel Vetter
2021-01-21  8:25     ` Daniel Vetter
2021-01-21  8:25     ` Daniel Vetter
2021-01-21  8:28     ` Christoph Hellwig
2021-01-21  8:28       ` Christoph Hellwig
2021-01-21  8:39       ` Daniel Vetter
2021-01-21  8:39         ` Daniel Vetter
2021-01-21  8:39         ` Daniel Vetter
2021-01-21  7:49 ` [PATCH 09/13] module: remove each_symbol_in_section Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 10/13] module: merge each_symbol_section into find_symbol Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 11/13] module: pass struct find_symbol_args to find_symbol Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-21  7:49 ` [PATCH 13/13] module: remove EXPORY_UNUSED_SYMBOL* Christoph Hellwig
2021-01-21  7:49   ` Christoph Hellwig
2021-01-27 13:49   ` Jessica Yu [this message]
2021-01-27 13:49     ` Jessica Yu
2021-01-27 13:49     ` Jessica Yu
2021-01-28 16:09     ` Christoph Hellwig
2021-01-28 16:09       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YBFvcmUiHRjkucbf@gunter \
    --to=jeyu@kernel.org \
    --cc=airlied@linux.ie \
    --cc=ajd@linux.ibm.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fbarrat@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=live-patching@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=masahiroy@kernel.org \
    --cc=mbenes@suse.cz \
    --cc=michal.lkml@markovi.net \
    --cc=mripard@kernel.org \
    --cc=pmladek@suse.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.