Signedness of char in BTF

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

 



Hi Yonghong and Andrii,

I have some questions re: signedness of chars in BTF. According to [1] BTF_INT_ENCODING() may be one of SIGNED, CHAR or BOOL. If I read [2] correctly the signedness of char is implementation defined. Does this mean that I need to know which implementation generated the BTF to interpret CHAR correctly?

Somewhat related, how to I make clang emit BTF_INT_CHAR in the first place? I've tried with clang-14, but only ever get

    [6] INT 'unsigned char' size=1 bits_offset=0 nr_bits=8 encoding=(none)
    [6] INT 'char' size=1 bits_offset=0 nr_bits=8 encoding=SIGNED

The kernel seems to agree that CHAR isn't a thing [3].

Thanks!
Lorenz

1: https://www.kernel.org/doc/html/latest/bpf/btf.html#btf-kind-int
2: https://stackoverflow.com/a/2054941/19544965
3: https://sourcegraph.com/github.com/torvalds/linux@353f7988dd8413c47718f7ca79c030b6fb62cfe5/-/blob/kernel/bpf/btf.c?L2928-2934



[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