mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Allan Xavier <allan.x.xavier@oracle.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] objtool: Fix GCC 8 cold function processing without -freorder-functions
Date: Wed, 27 Jun 2018 10:35:03 +0100	[thread overview]
Message-ID: <0556953a-3e9f-ff22-3514-b40ca7b5de1b@oracle.com> (raw)
In-Reply-To: <20180626184405.hsbuuq5eo7qzicoi@treble>

Looks good overall, just one comment.

On 26/06/18 19:44, Josh Poimboeuf wrote:
> +			/*
> +			 * Unfortunately, -fnoreorder-functions puts the child
> +			 * inside the parent.  Remove the overlap so we can
> +			 * have sane assumptions.
> +			 */
> +			if (sym->sec == pfunc->sec &&
> +			    sym->offset >= pfunc->offset &&
> +			    sym->offset < pfunc->offset + pfunc->len &&
> +			    sym->offset + sym->len == pfunc->offset + pfunc->len) {
> +				pfunc->len -= sym->len;

It's a bit of a nit but I'd say you could drop the third condition of the if
since sym->offset would have to be less than pfunc->offset + pfunc->len for the
fourth condition to ever be true. The only situation it would have caught is
where sym->len == 0, which I think (hope?) is reasonable to assume wont happen
and wouldn't have had an effect on pfunc->len anyway.

if (sym->sec == pfunc->sec &&
    sym->offset >= pfunc->offset &&
    sym->offset + sym->len == pfunc->offset + pfunc->len)

  parent reply	other threads:[~2018-06-27  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 16:20 Allan Xavier
2018-06-26 16:43 ` Peter Zijlstra
2018-06-26 18:31   ` Allan Xavier
2018-06-26 18:44     ` Josh Poimboeuf
2018-06-26 19:43       ` Peter Zijlstra
2018-06-26 21:07         ` Josh Poimboeuf
2018-06-27  9:35       ` Allan Xavier [this message]
2018-06-27 15:15         ` Josh Poimboeuf

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=0556953a-3e9f-ff22-3514-b40ca7b5de1b@oracle.com \
    --to=allan.x.xavier@oracle.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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®