Skip to content

Commit

Permalink
scripts/mksysmap: Ignore prefixed KCFI symbols
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
ptosi authored and masahir0y committed Jun 26, 2023
1 parent 1240dab commit 71025b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/mksysmap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71025b8

Please sign in to comment.