Add an is_cold_func() helper. No functional changes intended.
Unified · Split
| @@ -2614,7 +2614,7 @@ static void mark_holes(struct objtool_file *file) · 2613 unmodified lines | ||
| 2614 | 2614 | if (insn->jump_dest) { |
| 2615 | 2615 | struct symbol *dest_func = insn_func(insn->jump_dest); |
| 2616 | 2616 | |
| 2617 | − if (dest_func && dest_func->cold) | |
| 2617 | + if (dest_func && is_cold_func(dest_func)) | |
| 2618 | 2618 | dest_func->ignore = true; |
| 2619 | 2619 | } |
| 2620 | 2620 | } |
| @@ -4422,8 +4422,8 @@ static int create_prefix_symbol(struct objtool_file *file, struct symbol *func) · 1801 unmodified lines | ||
| 4422 | 4422 | char name[SYM_NAME_LEN]; |
| 4423 | 4423 | struct cfi_state *cfi; |
| 4424 | 4424 | |
| 4425 | − if (!is_func_sym(func) || is_prefix_func(func) || | |
| 4426 | − func->cold || func->static_call_tramp) | |
| 4425 | + if (!is_func_sym(func) || is_prefix_func(func) || is_cold_func(func) || | |
| 4426 | + func->static_call_tramp) | |
| 4427 | 4427 | return 0; |
| 4428 | 4428 | |
| 4429 | 4429 | if ((strlen(func->name) + sizeof("__pfx_") > SYM_NAME_LEN)) { |
| @@ -308,6 +308,11 @@ static inline bool is_prefix_func(struct symbol *sym) · 307 unmodified lines | ||
| 308 | 308 | return sym->prefix; |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | +static inline bool is_cold_func(struct symbol *sym) | |
| 312 | +{ | |
| 313 | + return sym->cold; | |
| 314 | +} | |
| 315 | + | |
| 311 | 316 | static inline bool is_reloc_sec(struct section *sec) |
| 312 | 317 | { |
| 313 | 318 | 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) · 1708 unmodified lines | ||
| 1709 | 1709 | unsigned long sympos; |
| 1710 | 1710 | void *func_data; |
| 1711 | 1711 | |
| 1712 | − if (!is_func_sym(sym) || sym->cold || !sym->clone || !sym->clone->changed) | |
| 1712 | + if (!is_func_sym(sym) || is_cold_func(sym) || | |
| 1713 | + !sym->clone || !sym->clone->changed) | |
| 1713 | 1714 | continue; |
| 1714 | 1715 | |
| 1715 | 1716 | /* allocate klp_func_ext */ |