summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-10-28 21:08:19 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-11-01 13:44:09 +0100
commitb341b20d648bb7e9a3307c33163e7399f0913e66 (patch)
tree4e17b455af51640eec3f16b30821e6dc35a33b80 /scripts
parent9f2899fe36a623885d8576604cb582328ad32b3c (diff)
downloadlinux-stable-b341b20d648bb7e9a3307c33163e7399f0913e66.tar.gz
linux-stable-b341b20d648bb7e9a3307c33163e7399f0913e66.tar.bz2
linux-stable-b341b20d648bb7e9a3307c33163e7399f0913e66.zip
x86: Add prefix symbols for function padding
When code is compiled with: -fpatchable-function-entry=${PADDING_BYTES},${PADDING_BYTES} functions will have PADDING_BYTES of NOP in front of them. Unwinders and other things that symbolize code locations will typically attribute these bytes to the preceding function. Given that these bytes nominally belong to the following symbol this mis-attribution is confusing. Inspired by the fact that CFI_CLANG emits __cfi_##name symbols to claim these bytes, use objtool to emit __pfx_##name symbols to do the same when CFI_CLANG is not used. This then shows the callthunk for symbol 'name' as: __pfx_##name+0x6/0x10 Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Yujie Liu <yujie.liu@intel.com> Link: https://lkml.kernel.org/r/20221028194453.592512209@infradead.org
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 85f02756dc9c..2e03bcbf2b9b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -265,6 +265,7 @@ objtool-args-$(CONFIG_STACK_VALIDATION) += --stackval
objtool-args-$(CONFIG_HAVE_STATIC_CALL_INLINE) += --static-call
objtool-args-$(CONFIG_HAVE_UACCESS_VALIDATION) += --uaccess
objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable
+objtool-args-$(CONFIG_PREFIX_SYMBOLS) += --prefix=$(CONFIG_FUNCTION_PADDING_BYTES)
objtool-args = $(objtool-args-y) \
$(if $(delay-objtool), --link) \