Messages in this thread | | | Date | Wed, 20 Oct 2021 10:25:52 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH 4/9] x86/alternative: Implement .retpoline_sites support |
| |
On Tue, Oct 19, 2021 at 09:49:13AM -0700, Josh Poimboeuf wrote:
> @@ -1916,8 +1930,25 @@ static int read_static_call_tramps(struct objtool_file *file) > list_for_each_entry(func, &sec->symbol_list, list) { > if (func->bind == STB_GLOBAL && > !strncmp(func->name, STATIC_CALL_TRAMP_PREFIX_STR, > - strlen(STATIC_CALL_TRAMP_PREFIX_STR))) > + strlen(STATIC_CALL_TRAMP_PREFIX_STR))) { > func->static_call_tramp = true; > + } > + } > + } > + > + return 0; > +} > + > +static int read_retpoline_thunks(struct objtool_file *file) > +{ > + struct section *sec; > + struct symbol *func; > + > + for_each_sec(file, sec) { > + list_for_each_entry(func, &sec->symbol_list, list) { > + if (func->bind == STB_GLOBAL && arch_is_retpoline(func)) { > + func->retpoline = true; > + } > } > }
I've folded these two identical loops over all symbols into a single classify_symbols() function.
| |