Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1996140rwd; Sun, 21 May 2023 10:28:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4oEJNXJxJA7sMU5q5Vok24ncm82VbxLEN0EUA1LJTdWpOkY/JZ8/RxzLoDdAiCeYw5jQPu X-Received: by 2002:a05:6a20:c995:b0:100:47a5:d754 with SMTP id gy21-20020a056a20c99500b0010047a5d754mr7280865pzb.23.1684690081217; Sun, 21 May 2023 10:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684690081; cv=none; d=google.com; s=arc-20160816; b=jmu0LQ1CPxm0krfOvnzAYp0D9RugM92ZWGzlLMLv6jMIocNnw3MvksR+aLQwIYXh7a jKs+rYzxjcpNYYd03KCCSYl6jarmvCk4GHbZN7U56tgV5UpOEr0ohb2U4K9m7+c/wEwf 9iBG+ZsN7VBAUdkvhXv6qFTOdZF9l5Ll6PAnkoj0SaiM/+A3yQCj+pGDZBsKYbOr+423 8yMHdXeXaONzTxd7rmqO1S5cPnGOvhyKTx/O1irxu0y+I4yEwlg+horngziIg6UZ//lT XqthQBmhl8QKT5WCmPFJdqJaqHBDjIeNR463FrvBvnZ5aj5mw2U+h2wFnN2FUpRccwLE h+hg== 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=3Fj5uGlHDA6HA+PmY3gvdxDuRIFCQUg3xVzh5ijmImY=; b=P3kTGfIjLYUAIF86vQXF4pc+PJbiQJnJ0p1KFIQp8HYSRpzYE/9beEis5oWAHQzyn/ KD11REq8u6FNCJaPkt+XHY4MFkyIeqj3RneOQogTQq23/o7V3kBV5p1g+7tGYO9BrDg9 nX/SEnlsBpjm0s3R33JB3L1cFsFOzbzQ9iht4pZl47XoJPz9jqnsXhZv9Ut/JF5Kw16S 6xFjyGvyM9OCld5ndCstppxSpwa4HYVJ4K9pRcglsfjT1nuiwzv6DQ5izNdH9gN8TMJg 7ERpYVgN17+swSFgYmrXRPDvvt/K1ZW/r3xGE83lUzvlqz1vV9B3FI9EZZI2LmiQWRNT BVvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ssgjpQhP; 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 1-20020a630201000000b005347efdfed3si3352323pgc.806.2023.05.21.10.19.01; Sun, 21 May 2023 10:28:01 -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=ssgjpQhP; 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 S230326AbjEUQFg (ORCPT + 99 others); Sun, 21 May 2023 12:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbjEUQF1 (ORCPT ); Sun, 21 May 2023 12:05:27 -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 F3732D2; Sun, 21 May 2023 09:05:25 -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 6924660ECB; Sun, 21 May 2023 16:05:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EB41C4339E; Sun, 21 May 2023 16:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684685124; bh=621Nlo8JQEog+0qRcxqr1Gngu/9Y6pP2Btj4yQo7BvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ssgjpQhP0UJdm8/pwcjsks+/LxMRn5wXE4R/AeWLExIo/RZ6mTxYxtzspxWR2TnEW hmzOW4v+2SmLKxfa34EHvdfZ0HdweiUaUww2KQbKQb+oRe3WZWAomiFnck9agvZ3bg HvByDO9lHsdXxXvWr0KYThNIg7w3o2SsmCNH6McQyerajs37JwuYj/cXFhVoolloMv cxI9Gq9dB/HXlNIXpswMskOjPfDnx5/35oOtWxUw39mbsebFuGD4fRcXoRzZn5SajK QQOks0X30wswEE+yjn6GN4h7Up6m4VxAvLViID0ntOOyPcmbB3bgeMZzUEV1Bynuw+ 02oVvGI+SbPiA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Masahiro Yamada Subject: [PATCH v6 06/20] modpost: unify 'sym' and 'to' in default_mismatch_handler() Date: Mon, 22 May 2023 01:04:11 +0900 Message-Id: <20230521160426.1881124-7-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230521160426.1881124-1-masahiroy@kernel.org> References: <20230521160426.1881124-1-masahiroy@kernel.org> 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: 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 6ac0d571542c..7848bacd4b42 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1166,11 +1166,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; @@ -1178,8 +1177,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(fromsec, fromsym, tosec, tosym)) @@ -1214,7 +1213,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