Re: gcc-8 objtool warnings

From: Arnd Bergmann
Date: Thu Aug 24 2017 - 17:14:59 EST


On Thu, Aug 24, 2017 at 9:19 PM, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> On Thu, Aug 24, 2017 at 12:14:27PM +0200, Arnd Bergmann wrote:
>> On Wed, Aug 23, 2017 at 6:01 PM, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>> > On Wed, Aug 23, 2017 at 03:38:02PM +0200, Arnd Bergmann wrote:
>> >> On Wed, Aug 23, 2017 at 2:48 PM, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>> >> > On Wed, Aug 23, 2017 at 02:22:34PM +0200, Arnd Bergmann wrote:
>> >> >> ...
>> >> >>
>> >> >> 0000000000000000 <put_cred_rcu.cold.1>:
>> >> >> 0: e8 00 00 00 00 callq 5 <put_cred_rcu.cold.1+0x5>
>> >> >> 1: R_X86_64_PC32 __sanitizer_cov_trace_pc-0x4
>> >> >> 5: 44 8b 8b 64 ff ff ff mov -0x9c(%rbx),%r9d
>> >> >> c: 48 8b 8b 68 ff ff ff mov -0x98(%rbx),%rcx
>> >> >> 13: 44 89 e2 mov %r12d,%edx
>> >> >> 16: 44 8b 83 60 ff ff ff mov -0xa0(%rbx),%r8d
>> >> >> 1d: 4c 89 ee mov %r13,%rsi
>> >> >> 20: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
>> >> >> 23: R_X86_64_32S .rodata.str1.8+0x28
>> >> >> 27: e8 00 00 00 00 callq 2c <__kstrtab_creds_are_invalid+0x3>
>> >> >> 28: R_X86_64_PC32 panic-0x4
>> >> >
>> >> > Thanks. Can you send me one of the .o files?
>> >>
>> >> Attached here now.
>> >
>> > Ok, looks like I'll need to add support for this new pattern (jumping to
>> > a .cold section in .text.unlikely).
>> >
>> > I'm also about to start work on fixing that other issue you found with
>> > GCC's inefficient update of the stack pointer.
>> >
>> > I really appreciate your finding all these warnings (and getting advance
>> > GCC 8 testing). Thanks again!
>>
>> No worries. I've disabled the four warnings in objtool that triggered now
>> and almost all are gone, but I still get a few warnings after doing additional
>> randconfig builds.
>
> Ok, I've got a fix for *most* of them below.
>
> Still need to fix the gc.o warning, which at first glance looks like a
> new switch statement pattern.
>
> The only one I don't understand is smscoreapi.o.
> smscore_set_device_mode() branches to smscore_set_device_mode.cold.13(),
> which just falls off the edge of the world. I don't know if it's a GCC
> bug, or a sancov GCC plugin bug, or if it's another "undefined behavior"
> issue. Would you mind rebuilding that one with CONFIG_DEBUG_INFO?
> Maybe that will give some more clues.

attached now.

> Also, a question about the GCC 8 development cycle. Since GCC 8 hasn't
> been released yet, I don't know whether it makes sense to "fix" objtool
> for it yet. Do you have any idea about when GCC 8 will be released?

They do major releases once a year, some time in spring, and bugfix
releases inbetween. 8.0.0 is the name of the prerelease snapshots, the
first official gcc-8 release will be 8.1.1.

I'll be on vacation for all of next week, starting tomorrow, so I won't
be able to do more testing for a while with your patch.

Arnd

Attachment: smscoreapi.o
Description: application/object