From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9915AC7EE29 for ; Thu, 8 Jun 2023 14:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ADv3z4HZl6jQ8Lf0QtEiX5nPp+TUNvSMmeojJF49A1o=; b=OY3pw5LlFlXakQ ochgecYQZG9+UV3Zl4SNg63ol7ngFoQeWXOcf8aOBvcUJm7YI+CvOzmO4OwQCoOZG5Mv37y4TGB/0 xZUiCtJXheF9kf3m9gGqaZL9slkxI0HHoCwTzEVZKxoIikmwYUwWSOSl+AuvT2RVhGWiYZpvl4Xkl hwyOuGsxVS7IKfPeLsv8gs55s+AgMhvv1l+ZztDRC2csgeCF+C4thU76KmFESbQGUod/QbOL3YIyu 0v/v+H2GAGsNwndF75We80VEODmw4AoXJidBKZ708Bu0FloP9K/s0i50A58gr4/63zjxBOQ8IWUAt D6wbsB3ETupKaKlsDOGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7GZM-009cIW-0q; Thu, 08 Jun 2023 14:24:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7GZJ-009cFw-0N for linux-um@lists.infradead.org; Thu, 08 Jun 2023 14:24:54 +0000 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 A691363CDC; Thu, 8 Jun 2023 14:24:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D15FEC4339E; Thu, 8 Jun 2023 14:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686234292; bh=Tv49Wx2718uLurHeG8QRHYpB10Ur4mWH5TKdeB3r3Yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9JMO6Pph34Rul/bfEipZsbH/IK6Vox1G/S4T29o1Wdi1nNe+QJlnzU4XJXkJYaIU nXfgGK/UyA4YVJmbYJ44YArzehdxORxGisVHczcGaz0lIW3qW/dtx3ycnuCzS4pELe xFxXjmKvLEQEHikSZ2h/6rqc2svxRMTZgD8MOChvOba2vOvZFjJcC7pogYoiih3mgl Al0swWVPGXkhliC/ypfGNWBzsnXVVghT4vwZ78cxfGKMw56aQQa61B7qAvki7CV0Ip ChWRSB4I/5XU6X5FQBKJkndAouaia2AOmZX50T0FsZIj1I4d2U8w7k4bSMidCpL3ih 5p5Oc9kuO/ZnA== 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 09/11] modpost: merge two similar section mismatch warnings Date: Thu, 8 Jun 2023 23:24:26 +0900 Message-Id: <20230608142428.256985-10-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_072453_190387_9EA4643E X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org In case of section mismatch, modpost shows slightly different messages. For extable section mismatch: "%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n" For the other cases: "%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n" They are similar. Merge them. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers --- scripts/mod/modpost.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index decb7d23ef9f..85df3f3ba9ee 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1147,21 +1147,10 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, sec_mismatch_count++; - switch (mismatch->mismatch) { - case TEXT_TO_ANY_INIT: - case DATA_TO_ANY_INIT: - case TEXTDATA_TO_ANY_EXIT: - case XXXINIT_TO_SOME_INIT: - case XXXEXIT_TO_SOME_EXIT: - case ANY_INIT_TO_ANY_EXIT: - case ANY_EXIT_TO_ANY_INIT: - warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n", - modname, fromsym, fromsec, tosym, tosec); - break; - case EXTABLE_TO_NON_TEXT: - warn("%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n", - modname, fromsec, (long)faddr, tosec, tosym); + warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n", + modname, fromsym, fromsec, tosym, tosec); + if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) { if (match(tosec, mismatch->bad_tosec)) fatal("The relocation at %s+0x%lx references\n" "section \"%s\" which is black-listed.\n" @@ -1181,7 +1170,6 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, else error("%s+0x%lx references non-executable section '%s'\n", fromsec, (long)faddr, tosec); - break; } } -- 2.39.2 _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um