On Tue, 2024-11-26 at 11:26 -0800, Andrii Nakryiko wrote: > On Thu, Nov 21, 2024 at 11:02 PM Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > > > btf_encoder__tag_kfuncs() reads .BTF_ids section to identify a set of > > kfuncs present in the ELF being processed. This section consists of > > records of the following shape: > > > > struct btf_id_and_flag { > > uint32_t id; > > uint32_t flags; > > }; > > > > Can we just set data->d_type to ELF_T_WORD and let libelf handle the byte swap? When I tried 'data->d_type = ELF_T_WORD' + gelf_xlatetom() snippet suggested by Tony Ambardar some time ago, I got a write protection error. Concluded that this is so, because file is opened in O_RDONLY mode. (Also please note v2 of this patch). [...]