History

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

Peter Zijlstra committed 4 years ago

Commit b341b201 parent 9f2899f2 files · +5 −0Browse files

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

Unified · Split

scripts/Makefile.lib+1−0
@@ -265,6 +265,7 @@ objtool-args-$(CONFIG_STACK_VALIDATION) += --stackval · 264 unmodified lines
265objtool-args-$(CONFIG_HAVE_STATIC_CALL_INLINE) += --static-call265objtool-args-$(CONFIG_HAVE_STATIC_CALL_INLINE) += --static-call
266objtool-args-$(CONFIG_HAVE_UACCESS_VALIDATION) += --uaccess266objtool-args-$(CONFIG_HAVE_UACCESS_VALIDATION) += --uaccess
267objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable267objtool-args-$(CONFIG_GCOV_KERNEL) += --no-unreachable
268objtool-args-$(CONFIG_PREFIX_SYMBOLS) += --prefix=$(CONFIG_FUNCTION_PADDING_BYTES)
268 269
269objtool-args = $(objtool-args-y) \270objtool-args = $(objtool-args-y) \
270 $(if $(delay-objtool), --link) \271 $(if $(delay-objtool), --link) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t