mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-24 02:09:13 -04:00
objtool: Add is_cold_func() helper
Add an is_cold_func() helper. No functional changes intended. Acked-by: Song Liu <song@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
This commit is contained in:
@@ -2614,7 +2614,7 @@ static void mark_holes(struct objtool_file *file)
|
||||
if (insn->jump_dest) {
|
||||
struct symbol *dest_func = insn_func(insn->jump_dest);
|
||||
|
||||
if (dest_func && dest_func->cold)
|
||||
if (dest_func && is_cold_func(dest_func))
|
||||
dest_func->ignore = true;
|
||||
}
|
||||
}
|
||||
@@ -4422,8 +4422,8 @@ static int create_prefix_symbol(struct objtool_file *file, struct symbol *func)
|
||||
char name[SYM_NAME_LEN];
|
||||
struct cfi_state *cfi;
|
||||
|
||||
if (!is_func_sym(func) || is_prefix_func(func) ||
|
||||
func->cold || func->static_call_tramp)
|
||||
if (!is_func_sym(func) || is_prefix_func(func) || is_cold_func(func) ||
|
||||
func->static_call_tramp)
|
||||
return 0;
|
||||
|
||||
if ((strlen(func->name) + sizeof("__pfx_") > SYM_NAME_LEN)) {
|
||||
|
||||
@@ -308,6 +308,11 @@ static inline bool is_prefix_func(struct symbol *sym)
|
||||
return sym->prefix;
|
||||
}
|
||||
|
||||
static inline bool is_cold_func(struct symbol *sym)
|
||||
{
|
||||
return sym->cold;
|
||||
}
|
||||
|
||||
static inline bool is_reloc_sec(struct section *sec)
|
||||
{
|
||||
return sec->sh.sh_type == SHT_RELA || sec->sh.sh_type == SHT_REL;
|
||||
|
||||
@@ -1709,7 +1709,8 @@ static int create_klp_sections(struct elfs *e)
|
||||
unsigned long sympos;
|
||||
void *func_data;
|
||||
|
||||
if (!is_func_sym(sym) || sym->cold || !sym->clone || !sym->clone->changed)
|
||||
if (!is_func_sym(sym) || is_cold_func(sym) ||
|
||||
!sym->clone || !sym->clone->changed)
|
||||
continue;
|
||||
|
||||
/* allocate klp_func_ext */
|
||||
|
||||
Reference in New Issue
Block a user