Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp923411rwd; Sun, 14 May 2023 08:57:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ojuTeDInP8Kh4buBv7hdNIttjeTy4R8xVDMYGQuMd5YzZkWUHAchKTUKp8nXdglGs4h5L X-Received: by 2002:a17:90a:c8a:b0:24e:3b85:a8a with SMTP id v10-20020a17090a0c8a00b0024e3b850a8amr486382pja.8.1684079860141; Sun, 14 May 2023 08:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684079860; cv=none; d=google.com; s=arc-20160816; b=lgBjAGp5k/gj9WwU1Zgl11k5c3mXY9cI14sT7MRq7WYpzc/Ola/AVWZh8tb3SmjdAq PLmqYhmNO+Sfe7umqNNV+YTwJ1n/BJpEL5r+59NQ7del7KAOzAY0zDJXBVItI5uXFNsM OebQYu/0HEbhdxAI6dMzELEuOL46/eszi8KqXeeXe4nZq17bVCVF9detrjrZ43mbCUWp SnB4EHBpZruTB5xs3olPf8V4lmuNPkLh8CXlIYOh0+f/FWIcPFvnXgbBw8l+BuwFZA3z yOMO45rzl7+Euz8nQPwjQXb1Z1bxqi7HakIBbADtH5A+PG5OWGSDg0UR4CzQisxyhwnx yEHg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kxt65QCx8Cv03Swynd6FpQ+E3vGBe0mZOttQy0ZoogA=; b=VVJHEMystO/mJM3Doi+AezhKkjXdMDPa1aJx0CKGbL21EFCTSmWMcUY8YajfcOs12Q N6xI8qSIXDaLzSfP9Hy9k3l5LuEVcqA+sLZQaqD9GrjEK4BTuHhROVHV0Yu+OQ8X4www z75KZESyj7WWq2Ih8l45EE1+8hGfPlwDR2GBKwraehfgdiLXSHDk6ad29iOIKmoKFdm/ 8kpnayQ6y3IL/pqhirUWyb13DThVHi6gaNxgFPsaoCSZFSdijT8yIKoFacHa7r43pI56 MpXUdiE0s/aiEjlkp5D5CeM+/x+o+xGrPPlfC8RpXQSuRTPg4e9pHHylZel6qBWMmZ65 haDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SIaplNVU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a63db58000000b00524cf947601si14245608pgi.23.2023.05.14.08.57.25; Sun, 14 May 2023 08:57:40 -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=SIaplNVU; 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 S238075AbjENP3L (ORCPT + 99 others); Sun, 14 May 2023 11:29:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238019AbjENP2r (ORCPT ); Sun, 14 May 2023 11:28:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 801864C24; Sun, 14 May 2023 08:28:24 -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 F1E68617F7; Sun, 14 May 2023 15:28:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93F56C43446; Sun, 14 May 2023 15:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684078099; bh=jdKsO6Q+89PLiGC8ptVEMm4O+hub0pEjU43lfsgo+Gg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SIaplNVUyNoeF+hWXtsAh302Y+3QfWgpRSJH7/xDlsKOGNKP3ikW7qMEm/PAV74V5 g/PmZEgFVowZXxJ3uTVfZHrEtK/aqGAvHoF5AusJeqV0CprPVYFv7jmRQiopBCQXGS RX6M4J9sWK3O8UlhPFdQHIKyqAMHMfGZ5JbXaikFjytY977Q3v3eMHcbpjXSU+ACWV xa8abpa6kUuoHyltOfyg/u/Av0DG8J7wJ7DqVnLqRjpywxvRyvov/exiZZIjb3E4ZK VSwbV1xhgpmJuJZda0PtEvlviAT9C16viTk4521WC+gg5v0d+qKEin6SqOk+Fhme8p zC0MhjwuSEqbQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Pitre , Nicolas Schier , Masahiro Yamada Subject: [PATCH v5 15/21] modpost: pass struct module pointer to check_section_mismatch() Date: Mon, 15 May 2023 00:27:33 +0900 Message-Id: <20230514152739.962109-16-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230514152739.962109-1-masahiroy@kernel.org> References: <20230514152739.962109-1-masahiroy@kernel.org> 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: X-Mailing-List: linux-kernel@vger.kernel.org The next commit will use it. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 28db215ecc71..23a352f52b8f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1246,7 +1246,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, } } -static void check_section_mismatch(const char *modname, struct elf_info *elf, +static void check_section_mismatch(struct module *mod, struct elf_info *elf, Elf_Sym *sym, unsigned int fsecndx, const char *fromsec, Elf_Addr faddr, Elf_Addr taddr) @@ -1257,7 +1257,7 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf, if (!mismatch) return; - default_mismatch_handler(modname, elf, mismatch, sym, + default_mismatch_handler(mod->name, elf, mismatch, sym, fsecndx, fromsec, faddr, tosec, taddr); } @@ -1367,7 +1367,7 @@ static int addend_mips_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) #define R_LARCH_SUB32 55 #endif -static void section_rela(const char *modname, struct elf_info *elf, +static void section_rela(struct module *mod, struct elf_info *elf, Elf_Shdr *sechdr) { Elf_Rela *rela; @@ -1413,12 +1413,12 @@ static void section_rela(const char *modname, struct elf_info *elf, break; } - check_section_mismatch(modname, elf, elf->symtab_start + r_sym, + check_section_mismatch(mod, elf, elf->symtab_start + r_sym, fsecndx, fromsec, r.r_offset, r.r_addend); } } -static void section_rel(const char *modname, struct elf_info *elf, +static void section_rel(struct module *mod, struct elf_info *elf, Elf_Shdr *sechdr) { Elf_Rel *rel; @@ -1468,7 +1468,7 @@ static void section_rel(const char *modname, struct elf_info *elf, fatal("Please add code to calculate addend for this architecture\n"); } - check_section_mismatch(modname, elf, elf->symtab_start + r_sym, + check_section_mismatch(mod, elf, elf->symtab_start + r_sym, fsecndx, fromsec, r.r_offset, r.r_addend); } } @@ -1485,19 +1485,19 @@ static void section_rel(const char *modname, struct elf_info *elf, * to find all references to a section that reference a section that will * be discarded and warns about it. **/ -static void check_sec_ref(const char *modname, struct elf_info *elf) +static void check_sec_ref(struct module *mod, struct elf_info *elf) { int i; Elf_Shdr *sechdrs = elf->sechdrs; /* Walk through all sections */ for (i = 0; i < elf->num_sections; i++) { - check_section(modname, elf, &elf->sechdrs[i]); + check_section(mod->name, elf, &elf->sechdrs[i]); /* We want to process only relocation sections and not .init */ if (sechdrs[i].sh_type == SHT_RELA) - section_rela(modname, elf, &elf->sechdrs[i]); + section_rela(mod, elf, &elf->sechdrs[i]); else if (sechdrs[i].sh_type == SHT_REL) - section_rel(modname, elf, &elf->sechdrs[i]); + section_rel(mod, elf, &elf->sechdrs[i]); } } @@ -1668,7 +1668,7 @@ static void read_symbols(const char *modname) sym_get_data(&info, sym)); } - check_sec_ref(modname, &info); + check_sec_ref(mod, &info); if (!mod->is_vmlinux) { version = get_modinfo(&info, "version"); -- 2.39.2