lkml.org 
[lkml]   [2018]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] objtool: Fix GCC 8 cold function processing without -freorder-functions
From
Date
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)

\
 
 \ /
  Last update: 2018-06-27 11:35    [W:0.088 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site