Re: [PATCH v3 23/26] kbuild/objtool: Add objtool-vmlinux.o pass

From: Josh Poimboeuf
Date: Tue Mar 24 2020 - 18:03:34 EST


On Tue, Mar 24, 2020 at 04:31:36PM +0100, Peter Zijlstra wrote:
> Now that objtool is capable of processing vmlinux.o and actually has
> something useful to do there, (conditionally) add it to the final link
> pass.
>
> This will increase build time by a few seconds.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
> lib/Kconfig.debug | 5 +++++
> scripts/link-vmlinux.sh | 24 ++++++++++++++++++++++++
> 2 files changed, 29 insertions(+)
>
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -379,6 +379,11 @@ config STACK_VALIDATION
> For more information, see
> tools/objtool/Documentation/stack-validation.txt.
>
> +config VMLINUX_VALIDATION
> + bool
> + depends on STACK_VALIDATION && DEBUG_ENTRY && !PARAVIRT
> + default y
> +

So I'm assuming this is incompatible with PARAVIRT because of all the
indirect pvops calls?

I'm thinking it should be easy to detect those and whitelist them
because they always have a pv_ops relocation associated with the call
instruction.

--
Josh