Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp778066rwd; Thu, 8 Jun 2023 07:38:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6CLnFaVpPnM9qBGy7w+QXCMsvL8NV2Kqfpn2RAr3wfnFBt8domjtzsR5LpWhCnlYns4CTq X-Received: by 2002:a17:903:32cf:b0:1b0:3841:bcda with SMTP id i15-20020a17090332cf00b001b03841bcdamr7669177plr.0.1686235121886; Thu, 08 Jun 2023 07:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686235121; cv=none; d=google.com; s=arc-20160816; b=YcbqQaESBAcNZlzi8i4s3Yp2dotVFSZ4Z0llXngy0wR6hDsYXyBZqZdIkVarTD1GVN k926MkcmBRqG5pYHfoUzF2Uxb2dyhUYM2baSE/BxtOrPCG9Mf+fAlO6jOmE+P80OyACq k35Ylz/0OIRfveH+tAm+9Dsd0Ook1GjM5fO7U8wnrIQnCkuAAgi7LqB/HaDw3PggF5KK CghpRoDANT1yMCayzlL5VzzRHcoJToszMEVbn1zfeXM/gwRVwwWVBf9Qx4hX7vbLPZ2e +d5BuOxYBkHE/lkdiq6wEFKNE/BsocLjLbmSaiItpFbNqyj/1JG40lr+in/JtfLwGy2r yodA== 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=InusXyno0XCVa+JZeOC3BOs6Sn0eGeJe2re8Vwwg5t4=; b=SUl95gZbHmfxyLypf7KeKHDV+qr1oBnPLO3EoclEiBYzZMaO8ZUPHtdpyEKsuvpfgg 4Wj9+Bu/wlEUc3P1j/wvZ9OOyoiipG7rxXKntILGQmt5B+uh0JDT+vAdbwbxxpALmCbO TwpEYnSVWF/w15+rGXGjpXLT6vqNPEVBEBv8LY+AR26r8z0VpAWoq2zlwuYx6Lzx5xdF q5ApRHEPPEhxmuq4D93XgLPYHCY1ffNmtBcuJZ3E7g69d+C0OwyVBiaZLkv/ZjEnaX2t 9w+DB1dFkjcUhtCzb2R4Dw/fRoQ7XllJHscLLdDgDcAlrM8VF5KwX1Wjqeo2QRRHGGKL iCxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tq32c9BM; 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 f17-20020a170902f39100b001ac4027fa28si1094430ple.618.2023.06.08.07.38.28; Thu, 08 Jun 2023 07:38:41 -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=Tq32c9BM; 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 S237146AbjFHOZj (ORCPT + 99 others); Thu, 8 Jun 2023 10:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236568AbjFHOZS (ORCPT ); Thu, 8 Jun 2023 10:25:18 -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 5D51D1FCC; Thu, 8 Jun 2023 07:24:56 -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 5B3A564E21; Thu, 8 Jun 2023 14:24:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81F59C4339C; Thu, 8 Jun 2023 14:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686234293; bh=iWuNSLxO6q6HZETxHyJL7TfXVCdA5aUkY9bgnycApiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tq32c9BM1jBz7n3OZOSVEKvK8CIw2f30Sc5jMXaFZuSj9ggqikMCPqn7VTj54d8A6 L7W6koyjYkTKWhvPAWAoB/DocpdbNRQmVt7Fb6QgmxXrdv5SFvwiXuL8uKm4M62mOT ftmyEiKKgMoxx1KrVuv7D09woIaGiWylwqoFWcfa8po12eMQYGGODmx4Jjd6AOO2NB jSFXVIwXS9dQM2AZy4hv9NMyrdZJnf8ZNCUki98sFcLHqDAtcH/nZ5J+a1tDBs1jx9 tN8MNU+VTiPXxDdZ/fUbebfIXPo80i69iWmxuCBkpsXXS1BIcMPA9IbSAXXAVIrTsq kp5GlTS6jU7DQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-um@lists.infradead.org, Masahiro Yamada Subject: [PATCH v7 10/11] modpost: show offset from symbol for section mismatch warnings Date: Thu, 8 Jun 2023 23:24:27 +0900 Message-Id: <20230608142428.256985-11-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230608142428.256985-1-masahiroy@kernel.org> References: <20230608142428.256985-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 Currently, modpost only shows the symbol names and section names, so it repeats the same message if there are multiple relocations in the same symbol. It is common the relocation spans across multiple instructions. It is better to show the offset from the symbol. Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 85df3f3ba9ee..40967ed816df 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1147,8 +1147,8 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, sec_mismatch_count++; - warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n", - modname, fromsym, fromsec, tosym, tosec); + warn("%s: section mismatch in reference: %s+0x%x (section: %s) -> %s (section: %s)\n", + modname, fromsym, (unsigned int)(faddr - from->st_value), fromsec, tosym, tosec); if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) { if (match(tosec, mismatch->bad_tosec)) -- 2.39.2