]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
objtool: Fix ".cold" section suffix check for newer versions of GCC
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 21 Jan 2021 21:29:19 +0000 (15:29 -0600)
committerJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 26 Jan 2021 17:11:59 +0000 (11:11 -0600)
With my version of GCC 9.3.1 the ".cold" subfunctions no longer have a
numbered suffix, so the trailing period is no longer there.

Presumably this doesn't yet trigger a user-visible bug since most of the
subfunction detection logic is duplicated.   I only found it when
testing vmlinux.o validation.

Fixes: 54262aa28301 ("objtool: Fix sibling call detection")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/ca0b5a57f08a2fbb48538dd915cc253b5edabb40.1611263461.git.jpoimboe@redhat.com
tools/objtool/check.c

index 081572170f6b34ca3e6d47927962fdc55c127396..c964cd56b557c4f43d2618f47e82b52a007f846f 100644 (file)
@@ -846,8 +846,8 @@ static int add_jump_destinations(struct objtool_file *file)
                         * case where the parent function's only reference to a
                         * subfunction is through a jump table.
                         */
-                       if (!strstr(insn->func->name, ".cold.") &&
-                           strstr(insn->jump_dest->func->name, ".cold.")) {
+                       if (!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;