Let me hand you a fresh bucket of curlies, you must've run out :-)
On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote: > +static struct symbol *first_file_symbol(struct elf *elf) > +{ > + struct symbol *sym; > + > + for_each_sym(elf, sym) { > + if (is_file_sym(sym)) > + return sym; } > + > + return NULL; > +} > + > +static struct symbol *next_file_symbol(struct elf *elf, struct symbol *sym) > +{ > + for_each_sym_continue(elf, sym) { > + if (is_file_sym(sym)) > + return sym; } > + > + return NULL; > +} > +static bool is_special_section(struct section *sec) > +{ > + static const char * const specials[] = { > + ".altinstructions", > + ".smp_locks", > + "__bug_table", > + "__ex_table", > + "__jump_table", > + "__mcount_loc", > + > + /* > + * Extract .static_call_sites here to inherit non-module > + * preferential treatment. The later static call processing > + * during klp module build will be skipped when it sees this > + * section already exists. > + */ > + ".static_call_sites", > + }; > + > + static const char * const non_special_discards[] = { > + ".discard.addressable", > + SYM_CHECKSUM_SEC, > + }; > + > + for (int i = 0; i < ARRAY_SIZE(specials); i++) > + if (!strcmp(sec->name, specials[i])) > + return true; > + > + /* Most .discard sections are special */ > + for (int i = 0; i < ARRAY_SIZE(non_special_discards); i++) { > + if (!strcmp(sec->name, non_special_discards[i])) > + return false; } > + > + return strstarts(sec->name, ".discard."); > +} > + > +/* > + * These sections are referenced by special sections but aren't considered > + * special sections themselves. > + */ > +static bool is_special_section_aux(struct section *sec) > +{ > + static const char * const specials_aux[] = { > + ".altinstr_replacement", > + ".altinstr_aux", > + }; > + > + for (int i = 0; i < ARRAY_SIZE(specials_aux); i++) { > + if (!strcmp(sec->name, specials_aux[i])) > + return true; } > + > + return false; > +} > + And possibly more..