All of lore.kernel.org
 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: Fri, 22 Jul 2022 13:25:33 +0200	[thread overview]
Message-ID: <8735et8k42.fsf@oracle.com> (raw)
In-Reply-To: <d56865b1-30dd-8761-2c12-ae5f66778de1@fb.com> (Yonghong Song's message of "Thu, 21 Jul 2022 15:52:40 -0700")


> 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

  reply	other threads:[~2022-07-22 11:26 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 [this message]
2022-07-22 15:59           ` Yonghong Song
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=8735et8k42.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 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.