[PATCH] D83242: [clang][BPF] support type exist/size and enum exist/value relocations

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 00:13:20 PDT 2020


yonghong-song added a comment.

> Hm.. This root type is used by libbpf to find candidate in kernel BTF. Name and kind of that type is what is used. When you have typedef t and struct t, their names match, but their kinds don't. So it could lead to inability to find a candidate.

The inproper CSE can only happen if the declaration in user program like `struct t { ... }; typedef struct t t;` and user try to find existence of both `struct t` and typedef `t`. We could have issue if kernel does not have `struct t { ...}` and only has `typedef t`. Theoretically this could happen, but as you mentioned the chance is really slim. So will not change current implementation right now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83242/new/

https://reviews.llvm.org/D83242



More information about the cfe-commits mailing list