mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] objtool: Fix GCC 8 cold subfunction detection for aliased functions
Date: Thu, 31 May 2018 11:35:09 -0500	[thread overview]
Message-ID: <20180531163509.rkvalvwbwtockh3n@treble> (raw)
In-Reply-To: <6d4fc778da0c8702b0d19882443ea33233af6fc3.1527696986.git.jpoimboe@redhat.com>

On Wed, May 30, 2018 at 11:16:39AM -0500, Josh Poimboeuf wrote:
> The kbuild test robot reported the following issue:
> 
>   kernel/time/posix-stubs.o: warning: objtool: sys_ni_posix_timers.cold.1()+0x0: unreachable instruction
> 
> This file creates symbol aliases for the sys_ni_posix_timers() function.
> So there are multiple ELF function symbols for the same function:
> 
>   23: 0000000000000150     26 FUNC    GLOBAL DEFAULT        1 __x64_sys_timer_create
>   24: 0000000000000150     26 FUNC    GLOBAL DEFAULT        1 sys_ni_posix_timers
>   25: 0000000000000150     26 FUNC    GLOBAL DEFAULT        1 __ia32_sys_timer_create
>   26: 0000000000000150     26 FUNC    GLOBAL DEFAULT        1 __x64_sys_timer_gettime
> 
> Here's the corresponding cold subfunction:
> 
>   11: 0000000000000000     45 FUNC    LOCAL  DEFAULT        6 sys_ni_posix_timers.cold.1
> 
> When analyzing overlapping functions, objtool only looks at the first
> one in the symbol list.  The rest of the functions are basically ignored
> because they point to instructions which have already been analyzed.
> 
> So in this case it analyzes the __x64_sys_timer_create() function, but
> then it fails to recognize that its cold subfunction is
> sys_ni_posix_timers.cold.1(), because the names are different.
> 
> Make the subfunction detection a little smarter by associating each
> subfunction with the first function which jumps to it, since that's the
> one which will be analyzed.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 13810435b9a7 ("objtool: Support GCC 8's cold subfunctions")
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>

NACK.  This adds another warning:

arch/x86/xen/enlighten.o: warning: objtool: xen_pin_vcpu()+0x4b: can't find switch jump table

-- 
Josh

      reply	other threads:[~2018-05-31 16:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 16:16 Josh Poimboeuf
2018-05-31 16:35 ` Josh Poimboeuf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180531163509.rkvalvwbwtockh3n@treble \
    --to=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®