[v7,00/11] Unify <linux/export.h> and <asm/export.h>, remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS
Message ID | 20230608142428.256985-1-masahiroy@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp384866rwl; Thu, 8 Jun 2023 07:53:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nnK2mfr+D15tuiUViv4z3b5LUtfruzF/ZpnIf2uJaUXpG+k3H7JMOgPnMRbm67nddb27y X-Received: by 2002:a17:90a:b38c:b0:252:94b5:36f1 with SMTP id e12-20020a17090ab38c00b0025294b536f1mr4323868pjr.27.1686235992774; Thu, 08 Jun 2023 07:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686235992; cv=none; d=google.com; s=arc-20160816; b=faA0aiu3L1ceOiET18eufRKAreGIxIFbpHztiv/yGrpuM7f9H9GYcw53Odj0HDif06 L0uZaN7+uu7rth0NED1SGdv96twurhEMMUMpb8z6EVb4u1hOPuT2v6hSY0CWit1fkuQE QzeM9xWtNcsk0m8Y9Ep/3od1CwgHgAp+K1ax0bactjQ/9sVG+UfqQoKftMpbOURNUCQ6 zco4fiEHtb0Z3GKE4AQ9NoLbwPpYK2Q2XOka2q4oH85re4tWrx9d562+2F7HYFEHeByn 8E51jIQK+DI/3Gu+4FOkSTfcVod3HXTK18zIHKEY0ibtukaaEBrwqxdd69SWLy2qIyKH ytzg== 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=4AhALuzCwWiaqt5G3OizoSFIz7MPYhuslsjPlLyyyEA=; b=gQdW348gJRl/RqDMKJgEAGxX3V+xlXPebf4Q7vufIL73RtF/ZyUpdRyeybWXQIPtJB 0ytn/R403nIr/ow4fouHNQd8NWusPk9oQql6XFrEXaya/tlchKfzbZ+mX2DfbyE5laYN Kl+GJKyi6YtCaJumHR1P35fj4M8OqmGIdyqJimqVB/uxluJ+L03XZb7BA9Tp3RXLVEHD F+xHoogstPAFZfuTWSZ4Gtolc7gtoLtAIqhKjEWeYwfOHDAjJJh0ebyOeJ7jdpuKL3rh ZFNMCVoAdQmIERUv0Z5IAyxtOFZ6JX+sb8sWc/RThNZNw2AtDIlgAASY2hzUj9CPYP0X 8vvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fRrTog57; 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 m2-20020a17090aab0200b00259ae5e1c8fsi1140353pjq.23.2023.06.08.07.52.57; Thu, 08 Jun 2023 07:53:12 -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=fRrTog57; 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 S237038AbjFHOY6 (ORCPT <rfc822;literming00@gmail.com> + 99 others); Thu, 8 Jun 2023 10:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237092AbjFHOYv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 8 Jun 2023 10:24:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6BBD2D64; Thu, 8 Jun 2023 07:24:37 -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 2FA8364E1C; Thu, 8 Jun 2023 14:24:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50F10C433EF; Thu, 8 Jun 2023 14:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686234276; bh=k+Mn9weSydYIaCuWNuvDX6AoybHLToDi+9bw3+6L3mE=; h=From:To:Cc:Subject:Date:From; b=fRrTog57JAttHS7m0CTWO4G3XgAr0HVzUMfMz+Jmj5OZPG0N0DW2sGdctfa4CGO1e L6rPljb+N0AK99eRTbYIESp6H+s+AtiYY6qRRcQyvCg86U2BQoRi1UYLk1lM0KmOfK AGKQ8hO4xvAjeyBD60CJJKpJJRO6A8qTgK4mFNx5vPy/x0BpHI3Nwsw1NS6XT8iDnH ArNDJGpgwarr95RA8NNW82gvmFyAwZbIsleYpLXawNwmtbBR5mblmfZ7XRceO182ys PJFSuNqp+b4GeEsh2Nw6PKKVMWIogyCKTroUDzVa7XSYBCwQ233h2/xGDvfoqph3oV i98Nwklk4pAiA== 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 Schier <nicolas@fjasle.eu>, linux-um@lists.infradead.org, Masahiro Yamada <masahiroy@kernel.org> Subject: [PATCH v7 00/11] Unify <linux/export.h> and <asm/export.h>, remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS Date: Thu, 8 Jun 2023 23:24:17 +0900 Message-Id: <20230608142428.256985-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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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?1768146592643854278?= X-GMAIL-MSGID: =?utf-8?q?1768146592643854278?= |
Series |
Unify <linux/export.h> and <asm/export.h>, remove EXPORT_DATA_SYMBOL(), faster TRIM_UNUSED_KSYMS
|
|
Message
Masahiro Yamada
June 8, 2023, 2:24 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. This patch set is applicable to linux-next 20230608. Previous version v6: https://lore.kernel.org/linux-kbuild/CAK7LNARjzGnj+sYX=_5yQ+8qoOQ2KB5N-_Ye53Ru3=XicezTYw@mail.gmail.com/T/#t v5: https://lore.kernel.org/linux-kbuild/CAK7LNARBiOywrMLbR=9N35sk19U0QM3xcPy7d1WqV-eyb4W23w@mail.gmail.com/T/#t 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 (11): Revert "[PATCH] uml: export symbols added by GCC hardened" 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 modpost: merge two similar section mismatch warnings modpost: show offset from symbol for section mismatch warnings linux/export.h: rename 'sec' argument to 'license' .gitignore | 2 - Makefile | 22 +-- 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 +- arch/um/os-Linux/user_syms.c | 7 - include/asm-generic/export.h | 83 +---------- include/asm-generic/vmlinux.lds.h | 1 + include/linux/export-internal.h | 49 +++++++ include/linux/export.h | 127 ++++------------ include/linux/pm.h | 14 +- kernel/module/internal.h | 12 ++ scripts/Makefile.build | 27 +--- scripts/Makefile.modpost | 7 + scripts/adjust_autoksyms.sh | 73 ---------- scripts/basic/fixdep.c | 3 +- scripts/check-local-export | 70 --------- scripts/gen_autoksyms.sh | 62 -------- scripts/gen_ksymdeps.sh | 30 ---- scripts/mod/modpost.c | 233 +++++++++++++++++++----------- scripts/mod/modpost.h | 1 + scripts/remove-stale-files | 4 + 23 files changed, 266 insertions(+), 569 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_autoksyms.sh delete mode 100755 scripts/gen_ksymdeps.sh