Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Fix up some outdated references to ENTRY/ENDPROC

ENTRY and ENDPROC were deprecated years ago and replaced with
SYM_FUNC_{START,END}. Fix up a few outdated references in the objtool
documentation and comments. Also fix a few typos.

Suggested-by: Brendan Jackman <jackmanb@google.com>
Suggested-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/5eb7e06e1a0e87aaeda8d583ab060e7638a6ea8e.1742852846.git.jpoimboe@kernel.org

authored by

Josh Poimboeuf and committed by
Ingo Molnar
24fe172b d39f82a0

+6 -10
-4
include/linux/linkage.h
··· 134 134 .size name, .-name 135 135 #endif 136 136 137 - /* If symbol 'name' is treated as a subroutine (gets called, and returns) 138 - * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of 139 - * static analysis tools such as stack depth analyzer. 140 - */ 141 137 #ifndef ENDPROC 142 138 /* deprecated, use SYM_FUNC_END */ 143 139 #define ENDPROC(name) \
+1 -1
include/linux/objtool.h
··· 69 69 * In asm, there are two kinds of code: normal C-type callable functions and 70 70 * the rest. The normal callable functions can be called by other code, and 71 71 * don't do anything unusual with the stack. Such normal callable functions 72 - * are annotated with the ENTRY/ENDPROC macros. Most asm code falls in this 72 + * are annotated with SYM_FUNC_{START,END}. Most asm code falls in this 73 73 * category. In this case, no special debugging annotations are needed because 74 74 * objtool can automatically generate the ORC data for the ORC unwinder to read 75 75 * at runtime.
+5 -5
tools/objtool/Documentation/objtool.txt
··· 34 34 - Return thunk annotation -- annotates all return thunk sites so kernel 35 35 can patch them inline, depending on enabled mitigations 36 36 37 - - Return thunk training valiation -- validate that all entry paths 37 + - Return thunk untraining validation -- validate that all entry paths 38 38 untrain a "safe return" before the first return (or call) 39 39 40 40 - Non-instrumentation validation -- validates non-instrumentable ··· 281 281 If the error is for an asm file, and func() is indeed a callable 282 282 function, add proper frame pointer logic using the FRAME_BEGIN and 283 283 FRAME_END macros. Otherwise, if it's not a callable function, remove 284 - its ELF function annotation by changing ENDPROC to END, and instead 285 - use the manual unwind hint macros in asm/unwind_hints.h. 284 + its ELF function annotation by using SYM_CODE_{START,END} and use the 285 + manual unwind hint macros in asm/unwind_hints.h. 286 286 287 287 If it's a GCC-compiled .c file, the error may be because the function 288 288 uses an inline asm() statement which has a "call" instruction. An ··· 352 352 This is a kernel entry/exit instruction like sysenter or iret. Such 353 353 instructions aren't allowed in a callable function, and are most 354 354 likely part of the kernel entry code. Such code should probably be 355 - placed in a SYM_FUNC_CODE block with unwind hints. 355 + placed in a SYM_CODE_{START,END} block with unwind hints. 356 356 357 357 358 358 6. file.o: warning: objtool: func()+0x26: sibling call from callable instruction with modified stack frame ··· 381 381 382 382 Another possibility is that the code has some asm or inline asm which 383 383 does some unusual things to the stack or the frame pointer. In such 384 - cases it's probably appropriate to use SYM_FUNC_CODE with unwind 384 + cases it's probably appropriate to use SYM_CODE_{START,END} with unwind 385 385 hints. 386 386 387 387