Re: [PATCH 04/13] objtool: Update documentation

From: Miroslav Benes
Date: Mon Mar 17 2025 - 06:54:31 EST


Hi,

> 1. Each callable function must be annotated as such with the ELF
> function type. In asm code, this is typically done using the
> - ENTRY/ENDPROC macros. If objtool finds a return instruction
> + SYM_FUNC_{START,END} macros. If objtool finds a return instruction
> outside of a function, it flags an error since that usually indicates
> callable code which should be annotated accordingly.

there is one more occurrence of ENDPROC/END under "1. file.o: warning:
objtool: func()+0x128: call without frame pointer save/setup" section
which might be nice to update as well.

> @@ -339,23 +351,21 @@ the objtool maintainers.
>
> This is a kernel entry/exit instruction like sysenter or iret. Such
> instructions aren't allowed in a callable function, and are most
> - likely part of the kernel entry code. They should usually not have
> - the callable function annotation (ENDPROC) and should always be
> - annotated with the unwind hint macros in asm/unwind_hints.h.
> + likely part of the kernel entry code. Such code should probably be
> + placed in a SYM_FUNC_CODE block with unwind hints.

SYM_CODE_{START,END} block?

> 7. file: warning: objtool: func()+0x5c: stack state mismatch
> @@ -371,8 +381,8 @@ the objtool maintainers.
>
> Another possibility is that the code has some asm or inline asm which
> does some unusual things to the stack or the frame pointer. In such
> - cases it's probably appropriate to use the unwind hint macros in
> - asm/unwind_hints.h.
> + cases it's probably appropriate to use SYM_FUNC_CODE with unwind
> + hints.

dtto

Miroslav