diff options
author | Yonghong Song <yhs@fb.com> | 2020-07-29 16:54:29 -0700 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2020-08-04 08:39:53 -0700 |
commit | 6d6750696400e7ce988d66a1a00e1d0cb32815f8 (patch) | |
tree | 2abddc3457895ddf963d519c5f09f826335bb1bd /llvm/lib/Support/CommandLine.cpp | |
parent | 14d726acd6041ee8fc595e48ec871b50b40ccc1d (diff) | |
download | llvm-6d6750696400e7ce988d66a1a00e1d0cb32815f8.zip llvm-6d6750696400e7ce988d66a1a00e1d0cb32815f8.tar.gz llvm-6d6750696400e7ce988d66a1a00e1d0cb32815f8.tar.bz2 |
[clang][BPF] support type exist/size and enum exist/value relocations
This patch added the following additional compile-once
run-everywhere (CO-RE) relocations:
- existence/size of typedef, struct/union or enum type
- enum value and enum value existence
These additional relocations will make CO-RE bpf programs more
adaptive for potential kernel internal data structure changes.
For existence/size relocations, the following two code patterns
are supported:
1. uint32_t __builtin_preserve_type_info(*(<type> *)0, flag);
2. <type> var;
uint32_t __builtin_preserve_field_info(var, flag);
flag = 0 for existence relocation and flag = 1 for size relocation.
For enum value existence and enum value relocations, the following code
pattern is supported:
uint64_t __builtin_preserve_enum_value(*(<enum_type> *)<enum_value>,
flag);
flag = 0 means existence relocation and flag = 1 for enum value.
relocation. In the above <enum_type> can be an enum type or
a typedef to enum type. The <enum_value> needs to be an enumerator
value from the same enum type. The return type is uint64_t to
permit potential 64bit enumerator values.
Differential Revision: https://reviews.llvm.org/D83242
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions