Re: [PATCH dwarves v1] btf_encoder: handle .BTF_ids section endianness when cross-compiling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

[...]






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux