diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-10 08:30:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-10 08:30:35 -0700 |
commit | a8a4021b776b4475e8a4657185a718cdfc07b88c (patch) | |
tree | 54a1c6a013247ea164351b156bf1cd8feaeeed56 /tools | |
parent | 3ca24ce9ff764bc27bceb9b2fd8ece74846c3fd3 (diff) | |
parent | 59dc6f3c6d81c0c4379025c4eb56919391d62b67 (diff) | |
download | linux-a8a4021b776b4475e8a4657185a718cdfc07b88c.tar.bz2 |
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core fixes from Thomas Gleixner:
"A small set of core updates:
- Make objtool cope with GCC8 oddities some more
- Remove a stale local_irq_save/restore sequence in the signal code
along with the stale comment in the RCU code. The underlying issue
which led to this has been solved long time ago, but nobody cared
to cleanup the hackarounds"
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
signal: Remove no longer required irqsave/restore
rcu: Update documentation of rcu_read_unlock()
objtool: Fix GCC 8 cold subfunction detection for aliased functions
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/check.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3a31b238f885..38047c6aa575 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -543,6 +543,28 @@ static int add_jump_destinations(struct objtool_file *file) dest_off); return -1; } + + /* + * For GCC 8+, create parent/child links for any cold + * subfunctions. This is _mostly_ redundant with a similar + * initialization in read_symbols(). + * + * If a function has aliases, we want the *first* such function + * in the symbol table to be the subfunction's parent. In that + * case we overwrite the initialization done in read_symbols(). + * + * However this code can't completely replace the + * read_symbols() code because this doesn't detect the case + * where the parent function's only reference to a subfunction + * is through a switch table. + */ + if (insn->func && insn->jump_dest->func && + insn->func != insn->jump_dest->func && + !strstr(insn->func->name, ".cold.") && + strstr(insn->jump_dest->func->name, ".cold.")) { + insn->func->cfunc = insn->jump_dest->func; + insn->jump_dest->func->pfunc = insn->func; + } } return 0; |