[v5,00/21] Unify <linux/export.h> and <asm/export.h>, remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS
Message ID | 20230514152739.962109-1-masahiroy@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6379250vqo; Sun, 14 May 2023 08:55:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sUd34aSNnU8VNmFVnkiIHPKcOJjZiCol0E/UoFYbQwx5ILJi+H3UsHLLeNLWkhsysptAW X-Received: by 2002:a05:6a00:1688:b0:647:5409:5d08 with SMTP id k8-20020a056a00168800b0064754095d08mr27718359pfc.17.1684079747116; Sun, 14 May 2023 08:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684079747; cv=none; d=google.com; s=arc-20160816; b=QuVBEAjtHbszb0P1PSyjUEH35/G92d4Bt/iWEMMnQLZNz0Ydxx5DMBPjZG2LOVcgkC RY+jol7yDs1GC8lLtsSIcDYHPUhfNT3OPPvBx+LWNesDk8+aqDcPr3Hib1NSKYK794AY fEE+H2jq4vElaFXqZOpCLOpN1PSwlnguG2s8pv3Ya90a2Gh8vNUDLrYNNAr1H0Q7bsdD vRMjl/Oj3rprhsuIP5avFALMUCwVi4XHNe88Q3yakyBrmGw2oGj2Cfx14Q4whAm9bxvN Bx85l0oB06ErCxw5yqierjmQzsqwX8gOA1iAU0HUsUaDTH59dPgmvzMgCa4RtAfw9Ht0 /srw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lKBFcFXFLFFZzQG2XSYWLWSBTBmbpRV//R1faWX6fmM=; b=UbKD4EhomNOSfEoMBCVre9nDB2rYNP5ii7nGzXZu+xqFbjomgzUqU9fjmU9kk8WaP/ d0kimdp8uVqQ05X5OaCcjhryCNEx34oBz8wEhb6WK4z/IrzNJ+uI+t3TNv/R1B11es1f HWq61IB4Se+MiEbjY8CxG6Fnn1C/xER6HQ+5sQwx/cFJN7HQ9hTW6EjwLKDWuTNvgIXG IyoTv38PP9xzgxVlPZVXrrCE2oANGnfv0ppCqRWg3Dyir+GDQTEtjyuGYZmi4yIJThjF rbDoJxVWap5UEAcyuLg2/awDt0FI0oUxLgYJuuu35dN2NbYh6PEdGK6cKUkjfJvxwoSh ztTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BhjrHIR+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020aa7941a000000b00643652c8879si15155451pfo.326.2023.05.14.08.55.24; Sun, 14 May 2023 08:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BhjrHIR+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233562AbjENP1t (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Sun, 14 May 2023 11:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjENP1s (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 14 May 2023 11:27:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85AE42699; Sun, 14 May 2023 08:27:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19FEC60C13; Sun, 14 May 2023 15:27:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D067CC433D2; Sun, 14 May 2023 15:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684078066; bh=r1tkmI2iEcOcIELwB2Ima7nyWT8YGyUf3YoSV3HSsU0=; h=From:To:Cc:Subject:Date:From; b=BhjrHIR+thZMHkL4EKvgyjDGybfhaLUJgiNhy6UwdeTUbLQhYMdnEC8+tGauN57x4 5wcbEV+2SQDUMH1LJJNqe0tm9aXNwvyk6tG+7SZZ2oJTWZ/Lv0iqZ0kM+nWNgSCS1u XacgDl9ukZn3RGRhFgX340Nc8KChwKWgp76mGl6wDur5pSp5ilTuu49viTPSIiaDKL oyvXORCnxtWYiRqtUWDJrh7OpKYZG6BTMiqQ5bTAwZMw1Qm17AJ5+YILyee7mpMTB3 iE51FA+D88JVngz6dCBR1mfiJnwjhp6sH5hl9UgvhH72ajHSaoJ3OI1eWX7GDrLlc7 rWvmQuM2UKXng== From: Masahiro Yamada <masahiroy@kernel.org> To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Pitre <npitre@baylibre.com>, Nicolas Schier <nicolas@fjasle.eu>, Masahiro Yamada <masahiroy@kernel.org> Subject: [PATCH v5 00/21] Unify <linux/export.h> and <asm/export.h>, remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS Date: Mon, 15 May 2023 00:27:18 +0900 Message-Id: <20230514152739.962109-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765816857014162443?= X-GMAIL-MSGID: =?utf-8?q?1765885605291724129?= |
Series |
Unify <linux/export.h> and <asm/export.h>, remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS
|
|
Message
Masahiro Yamada
May 14, 2023, 3:27 p.m. UTC
This patch set refactors modpost first to make it easier to add new code. My goals: - Refactors EXPORT_SYMBOL, <linux/export.h> and <asm/export.h>. You can still put EXPORT_SYMBOL() in *.S file, very close to the definition, but you do not need to care about whether it is a function or a data. This removes EXPORT_DATA_SYMBOL(). - Re-implement TRIM_UNUSED_KSYMS in one-pass. This makes the building faster. - Move the static EXPORT_SYMBOL check to modpost. This also makes the building faster. Previous version v4: https://lore.kernel.org/linux-kbuild/CAK7LNASDzy9RERN6+q6WgR4ROYZQue=SBqgbcoYuVePByHtk6Q@mail.gmail.com/T/#t v3: https://lore.kernel.org/all/20220928063947.299333-1-masahiroy@kernel.org/ Masahiro Yamada (21): modpost: remove broken calculation of exception_table_entry size modpost: remove fromsym info in __ex_table section mismatch warning modpost: remove get_prettyname() modpost: squash report_extable_warnings() into extable_mismatch_handler() modpost: squash report_sec_mismatch() into default_mismatch_handler() modpost: clean up is_executable_section() modpost: squash extable_mismatch_handler() into default_mismatch_handler() modpost: pass 'tosec' down to default_mismatch_handler() modpost: pass section index to find_elf_symbol2() modpost: rename find_elf_symbol() and find_elf_symbol2() modpost: modpost: refactor find_fromsym() and find_tosym() modpost: unify 'sym' and 'to' in default_mismatch_handler() modpost: replace r->r_offset, r->r_addend with faddr, taddr modpost: remove is_shndx_special() check from section_rel(a) modpost: pass struct module pointer to check_section_mismatch() kbuild: generate KSYMTAB entries by modpost ia64,export.h: replace EXPORT_DATA_SYMBOL* with EXPORT_SYMBOL* modpost: check static EXPORT_SYMBOL* by modpost again modpost: squash sym_update_namespace() into sym_add_exported() modpost: use null string instead of NULL pointer for default namespace kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion .gitignore | 1 - Makefile | 19 +- arch/ia64/include/asm/Kbuild | 1 + arch/ia64/include/asm/export.h | 3 - arch/ia64/kernel/head.S | 2 +- arch/ia64/kernel/ivt.S | 2 +- include/asm-generic/export.h | 83 +---- include/asm-generic/vmlinux.lds.h | 1 + include/linux/export-internal.h | 49 +++ include/linux/export.h | 119 ++----- include/linux/pm.h | 8 +- kernel/module/internal.h | 12 + scripts/Makefile.build | 19 +- scripts/Makefile.modpost | 7 + scripts/adjust_autoksyms.sh | 73 ---- scripts/basic/fixdep.c | 3 +- scripts/check-local-export | 70 ---- scripts/gen_ksymdeps.sh | 30 -- scripts/mod/modpost.c | 561 ++++++++++++------------------ scripts/mod/modpost.h | 1 + scripts/remove-stale-files | 2 + 21 files changed, 343 insertions(+), 723 deletions(-) delete mode 100644 arch/ia64/include/asm/export.h delete mode 100755 scripts/adjust_autoksyms.sh delete mode 100755 scripts/check-local-export delete mode 100755 scripts/gen_ksymdeps.sh
Comments
On Mon, May 15, 2023 at 12:27 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > This patch set refactors modpost first to make it easier to > add new code. > > My goals: > > - Refactors EXPORT_SYMBOL, <linux/export.h> and <asm/export.h>. > You can still put EXPORT_SYMBOL() in *.S file, very close to the definition, > but you do not need to care about whether it is a function or a data. > This removes EXPORT_DATA_SYMBOL(). > > - Re-implement TRIM_UNUSED_KSYMS in one-pass. > This makes the building faster. > > - Move the static EXPORT_SYMBOL check to modpost. > This also makes the building faster. > > Previous version > v4: https://lore.kernel.org/linux-kbuild/CAK7LNASDzy9RERN6+q6WgR4ROYZQue=SBqgbcoYuVePByHtk6Q@mail.gmail.com/T/#t > v3: https://lore.kernel.org/all/20220928063947.299333-1-masahiroy@kernel.org/ > 01-10 applied to linux-kbuild. I will send v6 for the rest. > > Masahiro Yamada (21): > modpost: remove broken calculation of exception_table_entry size > modpost: remove fromsym info in __ex_table section mismatch warning > modpost: remove get_prettyname() > modpost: squash report_extable_warnings() into > extable_mismatch_handler() > modpost: squash report_sec_mismatch() into default_mismatch_handler() > modpost: clean up is_executable_section() > modpost: squash extable_mismatch_handler() into > default_mismatch_handler() > modpost: pass 'tosec' down to default_mismatch_handler() > modpost: pass section index to find_elf_symbol2() > modpost: rename find_elf_symbol() and find_elf_symbol2() > modpost: modpost: refactor find_fromsym() and find_tosym() > modpost: unify 'sym' and 'to' in default_mismatch_handler() > modpost: replace r->r_offset, r->r_addend with faddr, taddr > modpost: remove is_shndx_special() check from section_rel(a) > modpost: pass struct module pointer to check_section_mismatch() > kbuild: generate KSYMTAB entries by modpost > ia64,export.h: replace EXPORT_DATA_SYMBOL* with EXPORT_SYMBOL* > modpost: check static EXPORT_SYMBOL* by modpost again > modpost: squash sym_update_namespace() into sym_add_exported() > modpost: use null string instead of NULL pointer for default namespace > kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion > > .gitignore | 1 - > Makefile | 19 +- > arch/ia64/include/asm/Kbuild | 1 + > arch/ia64/include/asm/export.h | 3 - > arch/ia64/kernel/head.S | 2 +- > arch/ia64/kernel/ivt.S | 2 +- > include/asm-generic/export.h | 83 +---- > include/asm-generic/vmlinux.lds.h | 1 + > include/linux/export-internal.h | 49 +++ > include/linux/export.h | 119 ++----- > include/linux/pm.h | 8 +- > kernel/module/internal.h | 12 + > scripts/Makefile.build | 19 +- > scripts/Makefile.modpost | 7 + > scripts/adjust_autoksyms.sh | 73 ---- > scripts/basic/fixdep.c | 3 +- > scripts/check-local-export | 70 ---- > scripts/gen_ksymdeps.sh | 30 -- > scripts/mod/modpost.c | 561 ++++++++++++------------------ > scripts/mod/modpost.h | 1 + > scripts/remove-stale-files | 2 + > 21 files changed, 343 insertions(+), 723 deletions(-) > delete mode 100644 arch/ia64/include/asm/export.h > delete mode 100755 scripts/adjust_autoksyms.sh > delete mode 100755 scripts/check-local-export > delete mode 100755 scripts/gen_ksymdeps.sh > > -- > 2.39.2 >