History

scripts/mksysmap: Ignore prefixed KCFI symbols

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.

Pierre-Clément Tosi committed 3 years ago

Commit 71025b81 parent 1240dab1 file · +2 −0Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/mksysmap+2−0
@@ -62,6 +62,8 @@ ${NM} -n ${1} | sed >${2} -e " · 61 unmodified lines
6262
6363 # CFI type identifiers
6464 / __kcfi_typeid_/d
65+/ __kvm_nvhe___kcfi_typeid_/d
66+/ __pi___kcfi_typeid_/d
6567
6668 # CRC from modversions
6769 / __crc_/d