On Fri, 2024-03-01 at 10:03 -0800, Andrii Nakryiko wrote: [...] > > Kernel rejects DATASEC name with '?'. > > The options are: > > 1. Tweak kernel to allow '?' as a first char in DATASEC names; > > 2. Use some different name, e.g. ".struct_ops.opt"; > > 3. Do some kind of BTF rewrite in libbpf to merge > > "?.struct_ops" and ".struct_ops" DATASECs as a single DATASEC. > > > > (1) is simple, but downside is requirement for kernel upgrade; > > (2) is simple, but goes against current convention for program section names; > > (3) idk, will check if that is feasible tomorrow. > > > > [0] https://github.com/eddyz87/bpf/tree/structops-multi-version > > > > > > Let's do 1) for sure (ELF allows pretty much any name for DATASEC). > And then detect this in libbpf, and if the kernel is old and doesn't > yet support it, change DATASEC name from "?.struct_ops" to just > ".struct_ops". Merging DATASECs seems like an unnecessary > complication. Yes, makes sense, half way there already, thank you.