File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
tools/testing/selftests/bpf Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ static struct core_reloc_test_case test_cases[] = {
452
452
/* size relocation checks */
453
453
SIZE_CASE (size ),
454
454
SIZE_CASE (size___diff_sz ),
455
+ SIZE_ERR_CASE (size___err_ambiguous ),
455
456
};
456
457
457
458
struct data {
Original file line number Diff line number Diff line change
1
+ #include "core_reloc_types.h"
2
+
3
+ void f (struct core_reloc_size___err_ambiguous1 x ,
4
+ struct core_reloc_size___err_ambiguous2 y ) {}
Original file line number Diff line number Diff line change @@ -809,3 +809,28 @@ struct core_reloc_size___diff_sz {
809
809
void * ptr_field ;
810
810
enum { OTHER_VALUE = 0xFFFFFFFFFFFFFFFF } enum_field ;
811
811
};
812
+
813
+ /* Error case of two candidates with the fields (int_field) at the same
814
+ * offset, but with differing final relocation values: size 4 vs size 1
815
+ */
816
+ struct core_reloc_size___err_ambiguous1 {
817
+ /* int at offset 0 */
818
+ int int_field ;
819
+
820
+ struct { int x ; } struct_field ;
821
+ union { int x ; } union_field ;
822
+ int arr_field [4 ];
823
+ void * ptr_field ;
824
+ enum { VALUE___1 = 123 } enum_field ;
825
+ };
826
+
827
+ struct core_reloc_size___err_ambiguous2 {
828
+ /* char at offset 0 */
829
+ char int_field ;
830
+
831
+ struct { int x ; } struct_field ;
832
+ union { int x ; } union_field ;
833
+ int arr_field [4 ];
834
+ void * ptr_field ;
835
+ enum { VALUE___2 = 123 } enum_field ;
836
+ };
You can’t perform that action at this time.
0 commit comments