public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Andi Kleen <andi@firstfloor.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kbuild@vger.kernel.org, Martin Liska <mliska@suse.cz>,
	Jiri Slaby <jslaby@suse.cz>
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	[thread overview]
Message-ID: <20221114114344.18650-39-jirislaby@kernel.org> (raw)
In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org>

From: Andi Kleen <andi@firstfloor.org>

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 <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Martin Liska <mliska@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 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
-- 
2.38.1


  parent reply	other threads:[~2022-11-14 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221114114344.18650-1-jirislaby@kernel.org>
2022-11-14 11:43 ` [PATCH 28/46] scripts, lto: re-add gcc-ld Jiri Slaby (SUSE)
2022-11-14 11:43 ` [PATCH 29/46] scripts, lto: use CONFIG_LTO for many LTO specific actions Jiri Slaby (SUSE)
2022-11-14 11:43 ` [PATCH 30/46] Kbuild, lto: Add Link Time Optimization support Jiri Slaby (SUSE)
2022-11-14 18:55   ` Josh Poimboeuf
2022-11-15 13:31     ` Martin Liška
2022-11-14 11:43 ` [PATCH 34/46] scripts, lto: disable gcc LTO for some mod sources Jiri Slaby (SUSE)
2022-11-14 11:43 ` [PATCH 35/46] Kbuild, lto: disable gcc LTO for bounds+asm-offsets Jiri Slaby (SUSE)
2022-11-14 11:43 ` Jiri Slaby (SUSE) [this message]
2022-11-14 11:43 ` [PATCH 43/46] scripts, lto: check C symbols for modversions Jiri Slaby (SUSE)
2022-11-14 11:43 ` [PATCH 44/46] scripts/bloat-o-meter, lto: handle gcc LTO Jiri Slaby (SUSE)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114114344.18650-39-jirislaby@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mliska@suse.cz \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox