All of lore.kernel.org
 help / color / mirror / Atom feed
* Signedness of char in BTF
@ 2022-07-21 14:31 Lorenz Bauer
  2022-07-21 14:54 ` Jose E. Marchesi
  2022-07-21 18:35 ` Yonghong Song
  0 siblings, 2 replies; 9+ messages in thread
From: Lorenz Bauer @ 2022-07-21 14:31 UTC (permalink / raw)
  To: yhs, andrii, bpf

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-08-02 17:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 14:31 Signedness of char in BTF Lorenz Bauer
2022-07-21 14:54 ` Jose E. Marchesi
2022-07-21 18:44   ` Yonghong Song
2022-07-21 22:21     ` Jose E. Marchesi
2022-07-21 22:52       ` Yonghong Song
2022-07-22 11:25         ` Jose E. Marchesi
2022-07-22 15:59           ` Yonghong Song
2022-08-02 17:28           ` Jose E. Marchesi
2022-07-21 18:35 ` Yonghong Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.