Commit 69cd8c6
committed
x86: Add prefix symbols for function padding
JIRA: https://issues.redhat.com/browse/RHEL-255
Conflicts:
scripts/Makefile.lib
- cs-9 doesn't have b42d230 ("kbuild: factor out the
common objtool arguments") or 9ec6ab6 ("kbuild: use
objtool-args-y to clean up objtool arguments"), which moved
moved objtool_args from scripts/Makefile.build and objtooltopt
from scripts/link-vmlinux.sh to scripts/Makefile.lib. Add the
--prefix option to both of former files instead.
At the same time, provide scripts/link-vmlinux.sh workarounds
to read the CONFIG_FUNCTION_PADDING_BYTES value and only
enable objtool for vmlinux.o given the same configuration
conditions in b42d230.
commit b341b20
Author: Peter Zijlstra <peterz@infradead.org>
Date: Fri Oct 28 21:08:19 2022 +0200
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
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>1 parent 6541539 commit 69cd8c6
3 files changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2484 | 2484 | | |
2485 | 2485 | | |
2486 | 2486 | | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2487 | 2491 | | |
2488 | 2492 | | |
2489 | 2493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
115 | 135 | | |
116 | 136 | | |
117 | 137 | | |
| |||
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
168 | 192 | | |
169 | 193 | | |
170 | 194 | | |
| |||
0 commit comments