lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2021-10-20 10:27    [W:0.119 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site