/* validate type existence, match, and size relocations */
TYPE_BASED_CASE(type_based, {
.struct_exists = 1,
+ .complex_struct_exists = 1,
.union_exists = 1,
.enum_exists = 1,
.typedef_named_struct_exists = 1,
.typedef_arr_exists = 1,
.struct_matches = 1,
+ .complex_struct_matches = 1,
.union_matches = 1,
.enum_matches = 1,
.typedef_named_struct_matches = 1,
}),
TYPE_BASED_CASE(type_based___diff, {
.struct_exists = 1,
+ .complex_struct_exists = 1,
.union_exists = 1,
.enum_exists = 1,
.typedef_named_struct_exists = 1,
.typedef_arr_exists = 1,
.struct_matches = 1,
+ .complex_struct_matches = 1,
.union_matches = 1,
.enum_matches = 1,
.typedef_named_struct_matches = 1,
*/
struct core_reloc_type_based_output {
bool struct_exists;
+ bool complex_struct_exists;
bool union_exists;
bool enum_exists;
bool typedef_named_struct_exists;
bool typedef_arr_exists;
bool struct_matches;
+ bool complex_struct_matches;
bool union_matches;
bool enum_matches;
bool typedef_named_struct_matches;
int x;
};
+struct a_complex_struct {
+ union {
+ struct a_struct * restrict a;
+ void *b;
+ } x;
+ volatile long y;
+};
+
union a_union {
int y;
int z;
struct core_reloc_type_based {
struct a_struct f1;
- union a_union f2;
- enum an_enum f3;
- named_struct_typedef f4;
- anon_struct_typedef f5;
- struct_ptr_typedef f6;
- int_typedef f7;
- enum_typedef f8;
- void_ptr_typedef f9;
- func_proto_typedef f10;
- arr_typedef f11;
+ struct a_complex_struct f2;
+ union a_union f3;
+ enum an_enum f4;
+ named_struct_typedef f5;
+ anon_struct_typedef f6;
+ struct_ptr_typedef f7;
+ int_typedef f8;
+ enum_typedef f9;
+ void_ptr_typedef f10;
+ func_proto_typedef f11;
+ arr_typedef f12;
};
/* no types in target */
int a;
};
+struct a_struct___forward;
+
+struct a_complex_struct___diff {
+ union {
+ struct a_struct___forward *a;
+ void *b;
+ } x;
+ volatile long y;
+};
+
union a_union___diff {
int z;
int y;
struct core_reloc_type_based___diff {
struct a_struct___diff f1;
- union a_union___diff f2;
- enum an_enum___diff f3;
- named_struct_typedef___diff f4;
- anon_struct_typedef___diff f5;
- struct_ptr_typedef___diff f6;
- int_typedef___diff f7;
- enum_typedef___diff f8;
- void_ptr_typedef___diff f9;
- func_proto_typedef___diff f10;
- arr_typedef___diff f11;
+ struct a_complex_struct___diff f2;
+ union a_union___diff f3;
+ enum an_enum___diff f4;
+ named_struct_typedef___diff f5;
+ anon_struct_typedef___diff f6;
+ struct_ptr_typedef___diff f7;
+ int_typedef___diff f8;
+ enum_typedef___diff f9;
+ void_ptr_typedef___diff f10;
+ func_proto_typedef___diff f11;
+ arr_typedef___diff f12;
};
/* different type sizes, extra modifiers, anon vs named enums, etc */
int x;
};
+struct a_complex_struct {
+ union {
+ struct a_struct *a;
+ void *b;
+ } x;
+ volatile long y;
+};
+
union a_union {
int y;
int z;
struct core_reloc_type_based_output {
bool struct_exists;
+ bool complex_struct_exists;
bool union_exists;
bool enum_exists;
bool typedef_named_struct_exists;
bool typedef_arr_exists;
bool struct_matches;
+ bool complex_struct_matches;
bool union_matches;
bool enum_matches;
bool typedef_named_struct_matches;
struct core_reloc_type_based_output *out = (void *)&data.out;
out->struct_exists = bpf_core_type_exists(struct a_struct);
+ out->complex_struct_exists = bpf_core_type_exists(struct a_complex_struct);
out->union_exists = bpf_core_type_exists(union a_union);
out->enum_exists = bpf_core_type_exists(enum an_enum);
out->typedef_named_struct_exists = bpf_core_type_exists(named_struct_typedef);
out->typedef_arr_exists = bpf_core_type_exists(arr_typedef);
out->struct_matches = bpf_core_type_matches(struct a_struct);
+ out->complex_struct_matches = bpf_core_type_matches(struct a_complex_struct);
out->union_matches = bpf_core_type_matches(union a_union);
out->enum_matches = bpf_core_type_matches(enum an_enum);
out->typedef_named_struct_matches = bpf_core_type_matches(named_struct_typedef);