linux-stable/tools/objtool
Peter Zijlstra 9f2899fe36 objtool: Add option to generate prefix symbols
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, allow objtool to emit __pfx_##name symbols to do
the same.

Therefore add the objtool --prefix=N argument, to conditionally place
a __pfx_##name symbol at N bytes ahead of symbol 'name' when: all
these preceding bytes are NOP and name-N is an instruction boundary.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Yujie Liu <yujie.liu@intel.com>
Link: https://lkml.kernel.org/r/20221028194453.526899822@infradead.org
2022-11-01 13:44:09 +01:00
..
arch/x86 objtool: Allow !PC relative relocations 2022-10-17 16:41:06 +02:00
Documentation objtool: Update documentation 2022-04-22 12:32:05 +02:00
include/objtool objtool: Add option to generate prefix symbols 2022-11-01 13:44:09 +01:00
.gitignore objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
Build objtool: Ditch subcommands 2022-04-22 12:32:01 +02:00
builtin-check.c objtool: Add option to generate prefix symbols 2022-11-01 13:44:09 +01:00
check.c objtool: Add option to generate prefix symbols 2022-11-01 13:44:09 +01:00
elf.c objtool: Add option to generate prefix symbols 2022-11-01 13:44:09 +01:00
Makefile Kbuild updates for v5.19 2022-05-26 12:09:50 -07:00
objtool.c objtool: Add .call_sites section 2022-10-17 16:41:07 +02:00
orc_dump.c x86/unwind/orc: Change REG_SP_INDIRECT 2021-02-10 20:53:51 +01:00
orc_gen.c Merge branch 'objtool/urgent' 2021-10-07 00:40:17 +02:00
special.c objtool,x86: Replace alternatives with .retpoline_sites 2021-10-28 23:25:25 +02:00
sync-check.sh Merge branch 'x86/cpu' into WIP.x86/core, to merge the NOP changes & resolve a semantic conflict 2021-04-02 12:36:30 +02:00
weak.c objtool: Ditch subcommands 2022-04-22 12:32:01 +02:00