Skip to content

Commit bcb6fb5

Browse files
jpoimboeKAGA-KOKO
authored andcommitted
objtool: Support GCC 9 cold subfunction naming scheme
Starting with GCC 8, a lot of unlikely code was moved out of line to "cold" subfunctions in .text.unlikely. For example, the unlikely bits of: irq_do_set_affinity() are moved out to the following subfunction: irq_do_set_affinity.cold.49() Starting with GCC 9, the numbered suffix has been removed. So in the above example, the cold subfunction is instead: irq_do_set_affinity.cold() Tweak the objtool subfunction detection logic so that it detects both GCC 8 and GCC 9 naming schemes. Reported-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/015e9544b1f188d36a7f02fa31e9e95629aa5f50.1541040800.git.jpoimboe@redhat.com
1 parent 5b74498 commit bcb6fb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/objtool/elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static int read_symbols(struct elf *elf)
301301
if (sym->type != STT_FUNC)
302302
continue;
303303
sym->pfunc = sym->cfunc = sym;
304-
coldstr = strstr(sym->name, ".cold.");
304+
coldstr = strstr(sym->name, ".cold");
305305
if (!coldstr)
306306
continue;
307307

0 commit comments

Comments
 (0)