The builtin signature looks like:
unsigned type_id = __builtin_btf_type_id(expression);
The "expression" can be a normal C expression such as
1, var_a, var_a + 4, &var_a, var_b
The return value returns the BTF type_id for the "expression".
The relocation is also generated for the type_id assignment.
The relocation is in .btf.ext FieldReloc section.
- This is a WIP patch. Once we settle down the interface and tested by
Andrii. Will separate this patch into two, one for clang and one for
llvm and adds additional clang tests.