From: "Pierre-Clément Tosi" <ptosi@google.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Sami Tolvanen <samitolvanen@google.com>
Subject: [PATCH v2] scripts/mksysmap: Ignore prefixed KCFI symbols
Date: Mon, 26 Jun 2023 12:29:46 +0000 [thread overview]
Message-ID: <20230626122946.lspu73k24cinwobd@google.com> (raw)
In-Reply-To: <20230623140825.ehqk5ndl7uftstwy@google.com>
The (relatively) new KCFI feature in LLVM/Clang encodes type information
for C functions by generating symbols named __kcfi_typeid_<fname>, which
can then be referenced from assembly. However, some custom build rules
(e.g. nVHE or early PIE on arm64) use objcopy to add a prefix to all the
symbols in their object files, making mksysmap's ignore filter miss
those KCFI symbols.
Therefore, explicitly list those twice-prefixed KCFI symbols as ignored.
Alternatively, this could also be achieved in a less verbose way by
ignoring any symbol containing the string "__kcfi_typeid_". However,
listing the combined prefixes explicitly saves us from running the small
risk of ignoring symbols that should be kept.
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
---
Changes in v2:
Removed redundant filter for EFI KCFI symbol names.
scripts/mksysmap | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/mksysmap b/scripts/mksysmap
index 26f39772f7a5..9ba1c9da0a40 100755
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
@@ -62,6 +62,8 @@ ${NM} -n ${1} | sed >${2} -e "
# CFI type identifiers
/ __kcfi_typeid_/d
+/ __kvm_nvhe___kcfi_typeid_/d
+/ __pi___kcfi_typeid_/d
# CRC from modversions
/ __crc_/d
--
2.41.0.162.gfafddb0af9-goog
--
Pierre
parent reply other threads:[~2023-06-26 12:30 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20230623140825.ehqk5ndl7uftstwy@google.com>]
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=20230626122946.lspu73k24cinwobd@google.com \
--to=ptosi@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=ndesaulniers@google.com \
--cc=samitolvanen@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
all inboxes | Powered by JetHome®