BPF List
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Yonghong Song <yhs@fb.com>
Cc: Lorenz Bauer <oss@lmb.io>,
	andrii@kernel.org, bpf@vger.kernel.org, david.faust@oracle.com
Subject: Re: Signedness of char in BTF
Date: Tue, 02 Aug 2022 19:28:36 +0200	[thread overview]
Message-ID: <87mtcma723.fsf@oracle.com> (raw)
In-Reply-To: <8735et8k42.fsf@oracle.com> (Jose E. Marchesi's message of "Fri, 22 Jul 2022 13:25:33 +0200")


>> The llvm and pahole generate BTF_INT_BOOL when the dwarf type has
>> attribute DW_ATE_boolean.
>> But BTF_INT_BOOL is actually used in libbpf to differentiate
>> configuration values (CONFIG_* = 'y' vs. CONFIG_* = <value>)
>>
>> In llvm,
>>   uint8_t BTFEncoding;
>>   switch (Encoding) {
>>   case dwarf::DW_ATE_boolean:
>>     BTFEncoding = BTF::INT_BOOL;
>>     break;
>>   case dwarf::DW_ATE_signed:
>>   case dwarf::DW_ATE_signed_char:
>>     BTFEncoding = BTF::INT_SIGNED;
>>     break;
>>   case dwarf::DW_ATE_unsigned:
>>   case dwarf::DW_ATE_unsigned_char:
>>     BTFEncoding = 0;
>>     break;
>>   default:
>>     llvm_unreachable("Unknown BTFTypeInt Encoding");
>>   }
>
> I just sent a patch to make GCC behave the same way:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598702.html

This patch is now applied in GCC master.

  parent reply	other threads:[~2022-08-02 17:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-07-21 18:35 ` Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtcma723.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=david.faust@oracle.com \
    --cc=oss@lmb.io \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox