Re: gcc-8 objtool warnings

From: Arnd Bergmann
Date: Thu Sep 21 2017 - 09:27:43 EST


On Tue, Sep 19, 2017 at 11:39 PM, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> On Tue, Sep 19, 2017 at 10:43:31PM +0200, Arnd Bergmann wrote:

> -----
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Subject: [PATCH] objtool: Support unoptimized frame pointer setup
>
> Arnd Bergmann reported a bunch of warnings like:
>
> crypto/jitterentropy.o: warning: objtool: jent_fold_time()+0x3b: call without frame pointer save/setup
> crypto/jitterentropy.o: warning: objtool: jent_stuck()+0x1d: call without frame pointer save/setup
> crypto/jitterentropy.o: warning: objtool: jent_unbiased_bit()+0x15: call without frame pointer save/setup
> crypto/jitterentropy.o: warning: objtool: jent_read_entropy()+0x32: call without frame pointer save/setup
> crypto/jitterentropy.o: warning: objtool: jent_entropy_collector_free()+0x19: call without frame pointer save/setup
>
> and
>
> arch/x86/events/core.o: warning: objtool: collect_events uses BP as a scratch register
> arch/x86/events/core.o: warning: objtool: events_ht_sysfs_show()+0x22: call without frame pointer save/setup
>
> With certain rare configurations, GCC sometimes sets up the frame
> pointer with:
>
> lea (%rsp),%rbp
>
> instead of:
>
> mov %rsp,%rbp
>
> The instructions are equivalent, so treat the former like the latter.
>
> Reported-by: Arnd Bergmann <arnd@xxxxxxxx>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Confirmed, this fixes many configurations that had warnings before,
currently testing with gcc-6.3.

Arnd