Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp924591rwd; Sun, 14 May 2023 08:59:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47uY28O0CrRRXdP1qn6xu/impIJHjYJiZ6mZmvMlHz9+vutONEkp8bAYGggbScgdg19zr8 X-Received: by 2002:a05:6a00:15ce:b0:64c:a572:3953 with SMTP id o14-20020a056a0015ce00b0064ca5723953mr1113159pfu.18.1684079962131; Sun, 14 May 2023 08:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684079962; cv=none; d=google.com; s=arc-20160816; b=iA3wsHjyTYSrqNtw1HrRjsElcwHVbSLih7c5b6slUWC2dXxmRt6eQ4TG7HTcgzZ2U0 XqJ2QSDbnLL8Q5O1Ypyj93TPpbfA/vl5KUoPRIuP675v+DX+m3ReXW/K0BpRJFRxO4jh 2ebV+G520Kk4GNiTXaZnkYEfvvEZXkL44zY1o/ZJKePvw8AaKMyUHYhk74xCIzyHL+gA uUlpCyhC8sDxqXImvuh2KqYG9AtPjZGUPPY3iguCyb7Yr6s+ArM7nFZEGI0nY6VcLLA4 iobqEPXoYMVq6/kXekkfxhALut9fveZ4tRl/8ok+yNOl57D5au7JA7QcP6Dg0zaA5x5Z 6zcw== 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=pr1aKKObQB+tLFrl7b/01Rxq4gYa62sm0yX9FT062e8=; b=Rlr02NrQjIDTKCH6ttGMcZnSQuenEri5pcFM1R+/780RNNoJEROAZRhStSmpy25+lJ tCmqqdSDozE8C3OkPDhUfJhjv7yfP35W9w0692bTm/7RV560hGag5/RMdr5cL/ugdMBQ Wf3+aUlLMiwsitxdt3AvUDoqMimzyQkC+DV55gWeWqTCoEKMLCWCBX/Ahzc00RE90WDB VRhpfJ6DFx+Yp9HoD8x/axqWVgdBuYXJ6bCT8M1mIFWCv9cEj3WPf0RuWWk7IavSAQ0A Mwyyb/xobnnvMQZLHbx+Au+2U6MewjjIsZESZUNzfhC8+ncMeEMjMml+R4wt3hpTgVNT kS5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SvaA802Y; 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 a19-20020aa795b3000000b0063d26262efasi15083918pfk.187.2023.05.14.08.59.07; Sun, 14 May 2023 08:59:22 -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=SvaA802Y; 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 S237957AbjENP3E (ORCPT + 99 others); Sun, 14 May 2023 11:29:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237928AbjENP2p (ORCPT ); Sun, 14 May 2023 11:28:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F34530E1; Sun, 14 May 2023 08:28:20 -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 892D66177B; Sun, 14 May 2023 15:28:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EE91C433A1; Sun, 14 May 2023 15:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684078092; bh=QEbX8slSLfdvKL7Judwq4MdAmwErOXYMizfNrkW0R2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SvaA802YG5i64zcCH5bkd2MiFB9dxW07sbZ9brxB4sYAO3DuPmIMTsgWpsNmR2Bcx GdyYb81TnBG7+jMoUTqVnEg8FEmIYNwuGaL4Ry3U96M7EeHGD3aZmw4PUbbzs8hNAf IHrgVjocKb0TuqmdP+TSDSstluVD5NzPB8Dk2BAFTMeB2CVL+LPlHqBux6DVAUCDPb rFLq8t+JLkRJoehTyaIqnMwlTjuBxcuQC1T6JwQa8mIns461CxzfVVn4bi9CmPY7cn D88tIDJk7M4trYqiDlLxGNfz+zpGPpq9N+ACNpAf9P6wr54fvmQILMIWx9xxmeNpDu fx0fTqi7yLlhA== 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 12/21] modpost: unify 'sym' and 'to' in default_mismatch_handler() Date: Mon, 15 May 2023 00:27:30 +0900 Message-Id: <20230514152739.962109-13-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 find_tosym() takes 'sym' and stores the return value to another variable 'to'. You can use the same variable because we want to replace the original one when appropriate. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index d147e8f63e52..7601f2ca28ed 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1183,11 +1183,10 @@ static bool is_executable_section(struct elf_info *elf, unsigned int secndx) static void default_mismatch_handler(const char *modname, struct elf_info *elf, const struct sectioncheck* const mismatch, - Elf_Rela *r, Elf_Sym *sym, + Elf_Rela *r, Elf_Sym *tsym, unsigned int fsecndx, const char *fromsec, const char *tosec) { - Elf_Sym *to; Elf_Sym *from; const char *tosym; const char *fromsym; @@ -1195,8 +1194,8 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, from = find_fromsym(elf, r->r_offset, fsecndx); fromsym = sym_name(elf, from); - to = find_tosym(elf, r->r_addend, sym); - tosym = sym_name(elf, to); + tsym = find_tosym(elf, r->r_addend, tsym); + tosym = sym_name(elf, tsym); /* check whitelist - we may ignore it */ if (!secref_whitelist(mismatch, fromsec, fromsym, tosec, tosym)) @@ -1231,7 +1230,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, "You might get more information about where this is\n" "coming from by using scripts/check_extable.sh %s\n", fromsec, (long)r->r_offset, tosec, modname); - else if (is_executable_section(elf, get_secindex(elf, sym))) + else if (is_executable_section(elf, get_secindex(elf, tsym))) warn("The relocation at %s+0x%lx references\n" "section \"%s\" which is not in the list of\n" "authorized sections. If you're adding a new section\n" -- 2.39.2