diff options
| author | Josh Poimboeuf <jpoimboe@kernel.org> | 2025-09-17 09:03:37 -0700 |
|---|---|---|
| committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2025-10-14 14:46:46 -0700 |
| commit | 4ea029389bf0cc44da6d3a24a520200e060ce6bf (patch) | |
| tree | 47a9416e9dac0bb466127f30cf8e1c9d2ff1cf43 /tools/objtool/check.c | |
| parent | 25eac74b6bdbf6d15911b582e747e8ad12fcbf8f (diff) | |
| download | linux-4ea029389bf0cc44da6d3a24a520200e060ce6bf.tar.gz linux-4ea029389bf0cc44da6d3a24a520200e060ce6bf.zip | |
objtool: Mark .cold subfunctions
Introduce a flag to identify .cold subfunctions so they can be detected
easier and faster.
Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/check.c')
| -rw-r--r-- | tools/objtool/check.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index f38f4a2e4e29..1d28ff73ebc9 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1575,7 +1575,9 @@ static int add_jump_destinations(struct objtool_file *file) /* * Cross-function jump. */ - if (func && insn_func(jump_dest) && func != insn_func(jump_dest)) { + + if (func && insn_func(jump_dest) && !func->cold && + insn_func(jump_dest)->cold) { /* * For GCC 8+, create parent/child links for any cold @@ -1592,11 +1594,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(func->name, ".cold") && - strstr(insn_func(jump_dest)->name, ".cold")) { - func->cfunc = insn_func(jump_dest); - insn_func(jump_dest)->pfunc = func; - } + func->cfunc = insn_func(jump_dest); + insn_func(jump_dest)->pfunc = func; } if (jump_is_sibling_call(file, insn, jump_dest)) { @@ -4066,9 +4065,8 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio * If this hole jumps to a .cold function, mark it ignore too. */ if (insn->jump_dest && insn_func(insn->jump_dest) && - strstr(insn_func(insn->jump_dest)->name, ".cold")) { + insn_func(insn->jump_dest)->cold) insn_func(insn->jump_dest)->ignore = true; - } } return false; |
