]> git.baikalelectronics.ru Git - kernel.git/commitdiff
module: remove EXPORT_UNUSED_SYMBOL*
authorChristoph Hellwig <hch@lst.de>
Tue, 2 Feb 2021 12:13:34 +0000 (13:13 +0100)
committerJessica Yu <jeyu@kernel.org>
Mon, 8 Feb 2021 11:28:07 +0000 (12:28 +0100)
EXPORT_UNUSED_SYMBOL* is not actually used anywhere.  Remove the
unused functionality as we generally just remove unused code anyway.

Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
24 files changed:
arch/arm/configs/bcm2835_defconfig
arch/arm/configs/mxs_defconfig
arch/mips/configs/nlm_xlp_defconfig
arch/mips/configs/nlm_xlr_defconfig
arch/parisc/configs/generic-32bit_defconfig
arch/parisc/configs/generic-64bit_defconfig
arch/powerpc/configs/ppc6xx_defconfig
arch/s390/configs/debug_defconfig
arch/s390/configs/defconfig
arch/sh/configs/edosk7760_defconfig
arch/sh/configs/sdk7780_defconfig
arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig
arch/x86/tools/relocs.c
include/asm-generic/vmlinux.lds.h
include/linux/export.h
include/linux/module.h
init/Kconfig
kernel/module.c
scripts/checkpatch.pl
scripts/mod/modpost.c
scripts/mod/modpost.h
scripts/module.lds.S
tools/include/linux/export.h

index 44ff9cd88d81612b31d8e052f5332f2e721e31a1..d6c6c2e031c43a2e6c68b69ec3e2c6e89de00dcd 100644 (file)
@@ -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
index a9c6f32a9b1c9d04ddca4ea9d7690aadcb143a40..ca32446b187f5d61da868e8a6a0d9deecc611757 100644 (file)
@@ -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
index 72a211d2d556fd64b6689f3b822304307814b7bd..32c290611723257a2c3dac84a4ac6f8ced2726d6 100644 (file)
@@ -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
index 4ecb157e56d4272c17dd7abff83c941d54046296..bf9b9244929ecdbdea5915400a29abf7ebca7181 100644 (file)
@@ -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
index 3cbcfad5f7249d53cac0977e06323add28be0b31..7611d48c599e01269d0dd3222e752dff0c3a86db 100644 (file)
@@ -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
index 8f81fcbf04c413ed6b9ec798974d413a1b5b7b7f..53054b81461a10e10f1e1e7bf13c7c44384a0566 100644 (file)
@@ -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
index ef09f3cce1fa851d23ec9adf6f8c24e4e951b05f..34c3859040f9f7826e70b5a5fb702a6328364856 100644 (file)
@@ -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
index c4f6ff98a612cd8ca923faa479abb8a08a7f39d0..58e54d17e3154b81172a967c4934dac0f6bd39dc 100644 (file)
@@ -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
index 51135893cffe34ed9e6a81e7aead22308412daaa..b5e62c0d3e23e04a8c0915b0b195cbc599dedb11 100644 (file)
@@ -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
index 02ba622985769d146153a97aabaa9c03b1cda9d3..d77f54e906fd04fece65ad96cbd6a3fa402db36f 100644 (file)
@@ -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
index d10a0414123a519a5461f2054320f87d87072934..d53c4595fb2e98b284a5f88959b5e61e1dd93628 100644 (file)
@@ -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
index 78210793d357cf027b8a44419ec3b9447bdad98a..9c9c4a888b1dbf65dfe29b3b91a6666d2dff14cd 100644 (file)
@@ -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
index 9936528e19393afad0f87a89196e43dd2c52e171..b60bd2d8603499a88dcf0bedb164154cb818c982 100644 (file)
@@ -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
index 0d210d0e83e2417f29880691feca2509cb44f358..b9c577a3cacca6b6419b687c384456382e510744 100644 (file)
@@ -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|"
index 83243506e68b004fda9fe73836de379dc8a1662d..1fa338ac6a54776883df5ccc802d5ad2030e8035 100644 (file)
                __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 = .;                                  \
                __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)                                    \
index 362b64f8d4a7c22cda0131d6621f44420a10e4e1..6271a5d9c988fa71b6832ed420931f8755dfbc80 100644 (file)
@@ -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 */
index e6e50ee3041238573adfd99b9844f828e4ed8577..59f094fa6f744126617db8b4974b27b0faa95eaa 100644 (file)
@@ -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;
index b77c60f8b963d4ae43140cce57b4c19af2e28732..11b803b45c19959f8546e8e2db0ae9d76cb7eb7e 100644 (file)
@@ -2262,25 +2262,8 @@ config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
 
          If unsure, say N.
 
-config UNUSED_SYMBOLS
-       bool "Enable unused/obsolete exported symbols"
-       default y if X86
-       help
-         Unused but exported symbols make the kernel needlessly bigger.  For
-         that reason most of these unused exports will soon be removed.  This
-         option is provided temporarily to provide a transition period in case
-         some external kernel module needs one of these symbols anyway. If you
-         encounter such a case in your module, consider if you are actually
-         using the right API.  (rationale: since nobody in the kernel is using
-         this in a module, there is a pretty good chance it's actually the
-         wrong interface to use).  If you really need the symbol, please send a
-         mail to the linux kernel mailing list mentioning the symbol and why
-         you really need it, and what the merge plan to the mainline kernel for
-         your module is.
-
 config TRIM_UNUSED_KSYMS
        bool "Trim unused exported kernel symbols"
-       depends on !UNUSED_SYMBOLS
        help
          The kernel and some modules make many symbols available for
          other modules to use via EXPORT_SYMBOL() and variants. Depending
index 95186c9d81ea7a8da528d9f9e5600a5a49822328..93f360250bcbb1620f604299dcd8ee48f1945b95 100644 (file)
@@ -410,14 +410,6 @@ extern const struct kernel_symbol __start___ksymtab_gpl[];
 extern const struct kernel_symbol __stop___ksymtab_gpl[];
 extern const s32 __start___kcrctab[];
 extern const s32 __start___kcrctab_gpl[];
-#ifdef CONFIG_UNUSED_SYMBOLS
-extern const struct kernel_symbol __start___ksymtab_unused[];
-extern const struct kernel_symbol __stop___ksymtab_unused[];
-extern const struct kernel_symbol __start___ksymtab_unused_gpl[];
-extern const struct kernel_symbol __stop___ksymtab_unused_gpl[];
-extern const s32 __start___kcrctab_unused[];
-extern const s32 __start___kcrctab_unused_gpl[];
-#endif
 
 #ifndef CONFIG_MODVERSIONS
 #define symversion(base, idx) NULL
@@ -432,7 +424,6 @@ struct symsearch {
                NOT_GPL_ONLY,
                GPL_ONLY,
        } license;
-       bool unused;
 };
 
 struct find_symbol_arg {
@@ -456,19 +447,6 @@ static bool check_exported_symbol(const struct symsearch *syms,
 
        if (!fsa->gplok && syms->license == GPL_ONLY)
                return false;
-
-#ifdef CONFIG_UNUSED_SYMBOLS
-       if (syms->unused && fsa->warn) {
-               pr_warn("Symbol %s is marked as UNUSED, however this module is "
-                       "using it.\n", fsa->name);
-               pr_warn("This symbol will go away in the future.\n");
-               pr_warn("Please evaluate if this is the right api to use and "
-                       "if it really is, submit a report to the linux kernel "
-                       "mailing list together with submitting your code for "
-                       "inclusion.\n");
-       }
-#endif
-
        fsa->owner = owner;
        fsa->crc = symversion(syms->crcs, symnum);
        fsa->sym = &syms->start[symnum];
@@ -535,18 +513,10 @@ static bool find_symbol(struct find_symbol_arg *fsa)
 {
        static const struct symsearch arr[] = {
                { __start___ksymtab, __stop___ksymtab, __start___kcrctab,
-                 NOT_GPL_ONLY, false },
+                 NOT_GPL_ONLY },
                { __start___ksymtab_gpl, __stop___ksymtab_gpl,
                  __start___kcrctab_gpl,
-                 GPL_ONLY, false },
-#ifdef CONFIG_UNUSED_SYMBOLS
-               { __start___ksymtab_unused, __stop___ksymtab_unused,
-                 __start___kcrctab_unused,
-                 NOT_GPL_ONLY, true },
-               { __start___ksymtab_unused_gpl, __stop___ksymtab_unused_gpl,
-                 __start___kcrctab_unused_gpl,
-                 GPL_ONLY, true },
-#endif
+                 GPL_ONLY },
        };
        struct module *mod;
        unsigned int i;
@@ -561,20 +531,10 @@ static bool find_symbol(struct find_symbol_arg *fsa)
                                lockdep_is_held(&module_mutex)) {
                struct symsearch arr[] = {
                        { mod->syms, mod->syms + mod->num_syms, mod->crcs,
-                         NOT_GPL_ONLY, false },
+                         NOT_GPL_ONLY },
                        { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms,
                          mod->gpl_crcs,
-                         GPL_ONLY, false },
-#ifdef CONFIG_UNUSED_SYMBOLS
-                       { mod->unused_syms,
-                         mod->unused_syms + mod->num_unused_syms,
-                         mod->unused_crcs,
-                         NOT_GPL_ONLY, true },
-                       { mod->unused_gpl_syms,
-                         mod->unused_gpl_syms + mod->num_unused_gpl_syms,
-                         mod->unused_gpl_crcs,
-                         GPL_ONLY, true },
-#endif
+                         GPL_ONLY },
                };
 
                if (mod->state == MODULE_STATE_UNFORMED)
@@ -2274,10 +2234,6 @@ static int verify_exported_symbols(struct module *mod)
        } arr[] = {
                { mod->syms, mod->num_syms },
                { mod->gpl_syms, mod->num_gpl_syms },
-#ifdef CONFIG_UNUSED_SYMBOLS
-               { mod->unused_syms, mod->num_unused_syms },
-               { mod->unused_gpl_syms, mod->num_unused_gpl_syms },
-#endif
        };
 
        for (i = 0; i < ARRAY_SIZE(arr); i++) {
@@ -3290,16 +3246,6 @@ static int find_module_sections(struct module *mod, struct load_info *info)
                                     &mod->num_gpl_syms);
        mod->gpl_crcs = section_addr(info, "__kcrctab_gpl");
 
-#ifdef CONFIG_UNUSED_SYMBOLS
-       mod->unused_syms = section_objs(info, "__ksymtab_unused",
-                                       sizeof(*mod->unused_syms),
-                                       &mod->num_unused_syms);
-       mod->unused_crcs = section_addr(info, "__kcrctab_unused");
-       mod->unused_gpl_syms = section_objs(info, "__ksymtab_unused_gpl",
-                                           sizeof(*mod->unused_gpl_syms),
-                                           &mod->num_unused_gpl_syms);
-       mod->unused_gpl_crcs = section_addr(info, "__kcrctab_unused_gpl");
-#endif
 #ifdef CONFIG_CONSTRUCTORS
        mod->ctors = section_objs(info, ".ctors",
                                  sizeof(*mod->ctors), &mod->num_ctors);
@@ -3480,13 +3426,8 @@ static int check_module_license_and_versions(struct module *mod)
                pr_warn("%s: module license taints kernel.\n", mod->name);
 
 #ifdef CONFIG_MODVERSIONS
-       if ((mod->num_syms && !mod->crcs)
-           || (mod->num_gpl_syms && !mod->gpl_crcs)
-#ifdef CONFIG_UNUSED_SYMBOLS
-           || (mod->num_unused_syms && !mod->unused_crcs)
-           || (mod->num_unused_gpl_syms && !mod->unused_gpl_crcs)
-#endif
-               ) {
+       if ((mod->num_syms && !mod->crcs) ||
+           (mod->num_gpl_syms && !mod->gpl_crcs)) {
                return try_to_force_load(mod,
                                         "no versions for exported symbols");
        }
index 92e888ed939f9833a3b17f32ae7d15813ec4c46f..eabd2d5467b156af25fb9724fdbd09e054323129 100755 (executable)
@@ -4290,8 +4290,7 @@ sub process {
                if (defined $realline_next &&
                    exists $lines[$realline_next - 1] &&
                    !defined $suppress_export{$realline_next} &&
-                   ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
-                    $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
+                   ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/)) {
                        # Handle definitions which produce identifiers with
                        # a prefix:
                        #   XXX(foo);
@@ -4318,8 +4317,7 @@ sub process {
                }
                if (!defined $suppress_export{$linenr} &&
                    $prevline =~ /^.\s*$/ &&
-                   ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
-                    $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
+                   ($line =~ /EXPORT_SYMBOL.*\((.*)\)/)) {
 #print "FOO B <$lines[$linenr - 1]>\n";
                        $suppress_export{$linenr} = 2;
                }
index 25c1446055d16bb1f23231c6f57076103824d18c..20fc57837881abfa624e12110c521c7f251d5181 100644 (file)
@@ -43,8 +43,9 @@ static int allow_missing_ns_imports;
 static bool error_occurred;
 
 enum export {
-       export_plain,      export_unused,     export_gpl,
-       export_unused_gpl, export_unknown
+       export_plain,
+       export_gpl,
+       export_unknown
 };
 
 /* In kernel, this size is defined in linux/module.h;
@@ -301,9 +302,7 @@ static const struct {
        enum export export;
 } export_list[] = {
        { .str = "EXPORT_SYMBOL",            .export = export_plain },
-       { .str = "EXPORT_UNUSED_SYMBOL",     .export = export_unused },
        { .str = "EXPORT_SYMBOL_GPL",        .export = export_gpl },
-       { .str = "EXPORT_UNUSED_SYMBOL_GPL", .export = export_unused_gpl },
        { .str = "(unknown)",                .export = export_unknown },
 };
 
@@ -362,12 +361,8 @@ static enum export export_from_secname(struct elf_info *elf, unsigned int sec)
 
        if (strstarts(secname, "___ksymtab+"))
                return export_plain;
-       else if (strstarts(secname, "___ksymtab_unused+"))
-               return export_unused;
        else if (strstarts(secname, "___ksymtab_gpl+"))
                return export_gpl;
-       else if (strstarts(secname, "___ksymtab_unused_gpl+"))
-               return export_unused_gpl;
        else
                return export_unknown;
 }
@@ -376,12 +371,8 @@ static enum export export_from_sec(struct elf_info *elf, unsigned int sec)
 {
        if (sec == elf->export_sec)
                return export_plain;
-       else if (sec == elf->export_unused_sec)
-               return export_unused;
        else if (sec == elf->export_gpl_sec)
                return export_gpl;
-       else if (sec == elf->export_unused_gpl_sec)
-               return export_unused_gpl;
        else
                return export_unknown;
 }
@@ -585,12 +576,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
                        info->modinfo_len = sechdrs[i].sh_size;
                } else if (strcmp(secname, "__ksymtab") == 0)
                        info->export_sec = i;
-               else if (strcmp(secname, "__ksymtab_unused") == 0)
-                       info->export_unused_sec = i;
                else if (strcmp(secname, "__ksymtab_gpl") == 0)
                        info->export_gpl_sec = i;
-               else if (strcmp(secname, "__ksymtab_unused_gpl") == 0)
-                       info->export_unused_gpl_sec = i;
 
                if (sechdrs[i].sh_type == SHT_SYMTAB) {
                        unsigned int sh_link_idx;
@@ -2141,32 +2128,13 @@ static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
                error("GPL-incompatible module %s.ko uses GPL-only symbol '%s'\n",
                      m, s);
                break;
-       case export_unused_gpl:
-               error("GPL-incompatible module %s.ko uses GPL-only symbol marked UNUSED '%s'\n",
-                     m, s);
-               break;
        case export_plain:
-       case export_unused:
        case export_unknown:
                /* ignore */
                break;
        }
 }
 
-static void check_for_unused(enum export exp, const char *m, const char *s)
-{
-       switch (exp) {
-       case export_unused:
-       case export_unused_gpl:
-               warn("module %s.ko uses symbol '%s' marked UNUSED\n",
-                    m, s);
-               break;
-       default:
-               /* ignore */
-               break;
-       }
-}
-
 static void check_exports(struct module *mod)
 {
        struct symbol *s, *exp;
@@ -2197,7 +2165,6 @@ static void check_exports(struct module *mod)
 
                if (!mod->gpl_compatible)
                        check_for_gpl_usage(exp->export, basename, exp->name);
-               check_for_unused(exp->export, basename, exp->name);
        }
 }
 
index 834220de002bd1befa6a1303cd3d6c94e90c45e1..0c47ff95c0e227a1dbfd46ebe75965b6fca5e18c 100644 (file)
@@ -139,9 +139,7 @@ struct elf_info {
        Elf_Sym      *symtab_start;
        Elf_Sym      *symtab_stop;
        Elf_Section  export_sec;
-       Elf_Section  export_unused_sec;
        Elf_Section  export_gpl_sec;
-       Elf_Section  export_unused_gpl_sec;
        char         *strtab;
        char         *modinfo;
        unsigned int modinfo_len;
index d82b452e8a716877538fb4597d434fdb859c2c4c..24e8af579ce3789d5355a25bcf558c9b70fe4633 100644 (file)
@@ -11,12 +11,8 @@ SECTIONS {
 
        __ksymtab               0 : { *(SORT(___ksymtab+*)) }
        __ksymtab_gpl           0 : { *(SORT(___ksymtab_gpl+*)) }
-       __ksymtab_unused        0 : { *(SORT(___ksymtab_unused+*)) }
-       __ksymtab_unused_gpl    0 : { *(SORT(___ksymtab_unused_gpl+*)) }
        __kcrctab               0 : { *(SORT(___kcrctab+*)) }
        __kcrctab_gpl           0 : { *(SORT(___kcrctab_gpl+*)) }
-       __kcrctab_unused        0 : { *(SORT(___kcrctab_unused+*)) }
-       __kcrctab_unused_gpl    0 : { *(SORT(___kcrctab_unused_gpl+*)) }
 
        .init_array             0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
 
index 9f61349a8944e100cf6fafe6d6a17c7792c7e0b7..acb6f4daa2f0b48481714aea4470eb15ea679873 100644 (file)
@@ -3,7 +3,5 @@
 
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
-#define EXPORT_UNUSED_SYMBOL(sym)
-#define EXPORT_UNUSED_SYMBOL_GPL(sym)
 
 #endif