Re: [PATCH 1/3] objtool: Separate prefix code from stack validation code

From: Peter Zijlstra
Date: Thu Apr 13 2023 - 05:30:45 EST


On Wed, Apr 12, 2023 at 01:26:13PM -0700, Josh Poimboeuf wrote:
> Simplify the prefix code and make it a standalone feature.

The main thing being that you moved it all after
validate_reachable_instructions() ?


> +static int add_prefix_symbols(struct objtool_file *file)
> +{
> + struct section *sec;
> + struct symbol *func;
> + int ret, warnings = 0;
> +
> + for_each_sec(file, sec) {
> + if (!(sec->sh.sh_flags & SHF_EXECINSTR))
> + continue;
> +
> + list_for_each_entry(func, &sec->symbol_list, list) {

One of the other patches did a sec_for_each_symbol() thing.

> + if (func->type != STT_FUNC)
> + continue;
> +
> + add_prefix_symbol(file, func);
> + }
> + }
> +
> + return warnings;
> +}