On Tue, 2024-03-05 at 13:43 -0800, Andrii Nakryiko wrote: [...] > > @@ -761,12 +761,13 @@ static bool btf_name_offset_valid(const struct btf *btf, u32 offset) > > return offset < btf->hdr.str_len; > > } > > > > -static bool __btf_name_char_ok(char c, bool first) > > +static bool __btf_name_char_ok(char c, bool first, bool allow_qmark) > > { > > if ((first ? !isalpha(c) : > > !isalnum(c)) && > > c != '_' && > > - c != '.') > > + c != '.' && > > + (allow_qmark && first ? c != '?' : true)) > > ELF data section can have pretty much arbitrary characters in the > name. I don't think we should allow question mark only at the > beginning. Let's just allow any printable character, anywhere (for > DATASEC only, of course)? There is no danger in doing this, data > section name is not a variable name or some C identifier, and so won't > be used like that. Makes sense to me. Thank you for reviewing this patch-set, I've applied the changes, will share v4 tomorrow.