On Mon, May 26, 2025 at 08:47:00PM +0200, Peter Zijlstra wrote:
> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote:
> > +#define SEC_NAME_LEN 512
> > #define SYM_NAME_LEN 512
> >
>
> > +static int validate_ffunction_fdata_sections(struct elf *elf)
> > +{
> > + struct symbol *sym;
> > + bool found_text = false, found_data = false;
> > +
> > + for_each_sym(elf, sym) {
> > + char sec_name[SEC_NAME_LEN];
> > +
> > + if (!found_text && is_func_sym(sym)) {
> > + snprintf(sec_name, SEC_NAME_LEN, ".text.%s", sym->name);
>
> So given SYM_NAME_LEN is 512, this SEC_NAME_LEN should be at least 6
> more, no?
I suppose so. There's also the .rela.text.* and .klp.rela.sec_objname.*
prefixes. I'll just bump SEC_NAME_LEN to 1024.
I should also double check the snprintf() return codes.
--
Josh