From patchwork Mon Nov 14 11:43:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 13042184 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1379C4332F for ; Mon, 14 Nov 2022 11:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236247AbiKNLsL (ORCPT ); Mon, 14 Nov 2022 06:48:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236947AbiKNLra (ORCPT ); Mon, 14 Nov 2022 06:47:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07582222B4; Mon, 14 Nov 2022 03:45:30 -0800 (PST) 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 9A2BC61093; Mon, 14 Nov 2022 11:45:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DC2FC433B5; Mon, 14 Nov 2022 11:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426329; bh=VHTSznvRU1NJt50Gn5cdfooru5h/hvP+AUl+sJEGPhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vH2xVVq9a7oMkBu897W0gAjD0uxcCuvGq364us9j38XwBhoYpK8lFuUcFpiWDuxut Rsu0/3S/RibVjT4IyA5Ub6bRkMIFahMLJwEj0f0edsEqkwxelhgus+v7RrQCCfLaZl yen5wyyk4N+ExrJ4A27S61XQL3Gi4R11PvTXF6VSm+z9OG0ugUmGYAZ2tYiI+92bq8 VksRgFcyAPLh+LqhvXh0lLNY46bkwx/tzkFbOSiak1O6hcRKUI5jXUvXny8xqmM125 4+VUObmU1Ll+vN5aesZZUCHC75DdkqIjkZ5a+I8GAGHUQ4gfH9jf9Ytd/AE+00JKhF BioFZgDVl2A4w== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Andi Kleen , Masahiro Yamada , Michal Marek , Nick Desaulniers , linux-kbuild@vger.kernel.org, Martin Liska , Jiri Slaby Subject: [PATCH 38/46] Kbuild, lto: don't include weak source file symbols in System.map Date: Mon, 14 Nov 2022 12:43:36 +0100 Message-Id: <20221114114344.18650-39-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Andi Kleen The gcc LTO build can generate some extra weak source code file name symbols on the second kallsyms link like: 0000000002fdf20a W head64.c.552cf5a6 This causes the "Inconsistent kallsyms data" error due to mismatches in the stage1 vs stage2 kallsyms link. Filter those out when generating the System.map. Cc: Masahiro Yamada Cc: Michal Marek Cc: Nick Desaulniers Cc: linux-kbuild@vger.kernel.org Signed-off-by: Andi Kleen Signed-off-by: Martin Liska Signed-off-by: Jiri Slaby --- scripts/mksysmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/mksysmap b/scripts/mksysmap index 16a08b8ef2f8..0f19a44ab136 100755 --- a/scripts/mksysmap +++ b/scripts/mksysmap @@ -34,6 +34,7 @@ # U - undefined global symbols # N - debugging symbols # w - local weak symbols +# W - weak symbols if they contain .c. # readprofile starts reading symbols when _stext is found, and # continue until it finds a symbol which is not either of 'T', 't', @@ -57,4 +58,5 @@ $NM -n $1 | grep -v \ -e ' __kstrtab_' \ -e ' __kstrtabns_' \ -e ' L0$' \ + -e ' W .*\.c\.' \ > $2