From: Yonghong Song <yhs@fb.com>
To: "Jose E. Marchesi" <jose.marchesi@oracle.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: Fri, 22 Jul 2022 08:59:41 -0700 [thread overview]
Message-ID: <b152c348-d524-a94e-b5a2-1f3086749967@fb.com> (raw)
In-Reply-To: <8735et8k42.fsf@oracle.com>
On 7/22/22 4:25 AM, Jose E. Marchesi wrote:
>
>> 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
Sounds good. Thanks!
next prev parent reply other threads:[~2022-07-22 15:59 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 [this message]
2022-08-02 17:28 ` Jose E. Marchesi
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=b152c348-d524-a94e-b5a2-1f3086749967@fb.com \
--to=yhs@fb.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=david.faust@oracle.com \
--cc=jose.marchesi@oracle.com \
--cc=oss@lmb.io \
/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