From patchwork Sat Apr 2 13:00:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 12799137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BFF9C433EF for ; Sat, 2 Apr 2022 13:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354883AbiDBNCw (ORCPT ); Sat, 2 Apr 2022 09:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354867AbiDBNCw (ORCPT ); Sat, 2 Apr 2022 09:02:52 -0400 Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0804913F20; Sat, 2 Apr 2022 06:00:59 -0700 (PDT) Received: from grover.. (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-11.nifty.com with ESMTP id 232D0S3b030001; Sat, 2 Apr 2022 22:00:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com 232D0S3b030001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1648904430; bh=Hr0z8Jq2r4y/wTZlPQUO7u7pmOMOKaWWt9EOAuFI+cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qProg9plOvQmbMAM1AXRBD+3AfhOemIyo3ZLmQBPHPYeXWlzuYUMwcXT2S/mKdrRI EuGTKefjiKr16CXBhDnjwM20RYf9jt/F/xwalcW1jshqi4oP1BQ0+hYAXY6VduFmkx qCLAPA+ih05zaziSBKF07YpDdg4/8U4IBCDcPwFa2iySJKCI6lFSSi3jyPYhVbvUhF +aQutHG/QaXEKKqcIF2BVlpfL3j2ZZEUpM7J2U7uMYDROvSffaUiVGMXvQh/gC2h6N A7nThDIOW4Yt6PDtPNRtFHHWf92LBtHDZBTay1cgaoor0uxTP4AzAMtRDc2SBCoBVk gUp9EOeMVtnhg== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek , Nick Desaulniers Subject: [PATCH 2/2] modpost: move export_from_secname() call to more relevant place Date: Sat, 2 Apr 2022 22:00:14 +0900 Message-Id: <20220402130014.1417773-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220402130014.1417773-1-masahiroy@kernel.org> References: <20220402130014.1417773-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The value returned by export_from_secname() is only used by sym_add_exported(). Move export_from_secname() just above sym_add_exported(). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 194ca9083c7a..f9e54247ae1d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -684,12 +684,8 @@ static void handle_modversion(const struct module *mod, static void handle_symbol(struct module *mod, struct elf_info *info, const Elf_Sym *sym, const char *symname) { - enum export export; const char *name; - if (strstarts(symname, "__ksymtab")) - export = export_from_secname(info, get_secindex(info, sym)); - switch (sym->st_shndx) { case SHN_COMMON: if (strstarts(symname, "__gnu_lto_")) { @@ -724,7 +720,11 @@ static void handle_symbol(struct module *mod, struct elf_info *info, default: /* All exported symbols */ if (strstarts(symname, "__ksymtab_")) { + enum export export; + name = symname + strlen("__ksymtab_"); + export = export_from_secname(info, + get_secindex(info, sym)); sym_add_exported(name, mod, export); } if (strcmp(symname, "init_module") == 0)