1
1
#include <stdint.h>
2
2
#include <stdbool.h>
3
+
4
+ void preserce_ptr_sz_fn (long x ) {}
5
+
6
+ #define __bpf_aligned __attribute__((aligned(8)))
7
+
3
8
/*
4
9
* KERNEL
5
10
*/
@@ -444,59 +449,59 @@ struct core_reloc_primitives {
444
449
char a ;
445
450
int b ;
446
451
enum core_reloc_primitives_enum c ;
447
- void * d ;
448
- int (* f )(const char * );
452
+ void * d __bpf_aligned ;
453
+ int (* f )(const char * ) __bpf_aligned ;
449
454
};
450
455
451
456
struct core_reloc_primitives___diff_enum_def {
452
457
char a ;
453
458
int b ;
454
- void * d ;
455
- int (* f )(const char * );
459
+ void * d __bpf_aligned ;
460
+ int (* f )(const char * ) __bpf_aligned ;
456
461
enum {
457
462
X = 100 ,
458
463
Y = 200 ,
459
- } c ; /* inline enum def with differing set of values */
464
+ } c __bpf_aligned ; /* inline enum def with differing set of values */
460
465
};
461
466
462
467
struct core_reloc_primitives___diff_func_proto {
463
- void (* f )(int ); /* incompatible function prototype */
464
- void * d ;
465
- enum core_reloc_primitives_enum c ;
468
+ void (* f )(int ) __bpf_aligned ; /* incompatible function prototype */
469
+ void * d __bpf_aligned ;
470
+ enum core_reloc_primitives_enum c __bpf_aligned ;
466
471
int b ;
467
472
char a ;
468
473
};
469
474
470
475
struct core_reloc_primitives___diff_ptr_type {
471
- const char * const d ; /* different pointee type + modifiers */
472
- char a ;
476
+ const char * const d __bpf_aligned ; /* different pointee type + modifiers */
477
+ char a __bpf_aligned ;
473
478
int b ;
474
479
enum core_reloc_primitives_enum c ;
475
- int (* f )(const char * );
480
+ int (* f )(const char * ) __bpf_aligned ;
476
481
};
477
482
478
483
struct core_reloc_primitives___err_non_enum {
479
484
char a [1 ];
480
485
int b ;
481
486
int c ; /* int instead of enum */
482
- void * d ;
483
- int (* f )(const char * );
487
+ void * d __bpf_aligned ;
488
+ int (* f )(const char * ) __bpf_aligned ;
484
489
};
485
490
486
491
struct core_reloc_primitives___err_non_int {
487
492
char a [1 ];
488
- int * b ; /* ptr instead of int */
489
- enum core_reloc_primitives_enum c ;
490
- void * d ;
491
- int (* f )(const char * );
493
+ int * b __bpf_aligned ; /* ptr instead of int */
494
+ enum core_reloc_primitives_enum c __bpf_aligned ;
495
+ void * d __bpf_aligned ;
496
+ int (* f )(const char * ) __bpf_aligned ;
492
497
};
493
498
494
499
struct core_reloc_primitives___err_non_ptr {
495
500
char a [1 ];
496
501
int b ;
497
502
enum core_reloc_primitives_enum c ;
498
503
int d ; /* int instead of ptr */
499
- int (* f )(const char * );
504
+ int (* f )(const char * ) __bpf_aligned ;
500
505
};
501
506
502
507
/*
@@ -507,7 +512,7 @@ struct core_reloc_mods_output {
507
512
};
508
513
509
514
typedef const int int_t ;
510
- typedef const char * char_ptr_t ;
515
+ typedef const char * char_ptr_t __bpf_aligned ;
511
516
typedef const int arr_t [7 ];
512
517
513
518
struct core_reloc_mods_substruct {
@@ -523,9 +528,9 @@ typedef struct {
523
528
struct core_reloc_mods {
524
529
int a ;
525
530
int_t b ;
526
- char * c ;
531
+ char * c __bpf_aligned ;
527
532
char_ptr_t d ;
528
- int e [3 ];
533
+ int e [3 ] __bpf_aligned ;
529
534
arr_t f ;
530
535
struct core_reloc_mods_substruct g ;
531
536
core_reloc_mods_substruct_t h ;
@@ -535,9 +540,9 @@ struct core_reloc_mods {
535
540
struct core_reloc_mods___mod_swap {
536
541
int b ;
537
542
int_t a ;
538
- char * d ;
543
+ char * d __bpf_aligned ;
539
544
char_ptr_t c ;
540
- int f [3 ];
545
+ int f [3 ] __bpf_aligned ;
541
546
arr_t e ;
542
547
struct {
543
548
int y ;
@@ -555,7 +560,7 @@ typedef arr1_t arr2_t;
555
560
typedef arr2_t arr3_t ;
556
561
typedef arr3_t arr4_t ;
557
562
558
- typedef const char * const volatile fancy_char_ptr_t ;
563
+ typedef const char * const volatile fancy_char_ptr_t __bpf_aligned ;
559
564
560
565
typedef core_reloc_mods_substruct_t core_reloc_mods_substruct_tt ;
561
566
@@ -567,7 +572,7 @@ struct core_reloc_mods___typedefs {
567
572
arr4_t e ;
568
573
fancy_char_ptr_t d ;
569
574
fancy_char_ptr_t c ;
570
- int3_t b ;
575
+ int3_t b __bpf_aligned ;
571
576
int3_t a ;
572
577
};
573
578
@@ -739,19 +744,19 @@ struct core_reloc_bitfields___bit_sz_change {
739
744
int8_t sb4 : 1 ; /* 4 -> 1 */
740
745
int32_t sb20 : 30 ; /* 20 -> 30 */
741
746
/* non-bitfields */
742
- uint16_t u32 ; /* 32 -> 16 */
743
- int64_t s32 ; /* 32 -> 64 */
747
+ uint16_t u32 ; /* 32 -> 16 */
748
+ int64_t s32 __bpf_aligned ; /* 32 -> 64 */
744
749
};
745
750
746
751
/* turn bitfield into non-bitfield and vice versa */
747
752
struct core_reloc_bitfields___bitfield_vs_int {
748
753
uint64_t ub1 ; /* 3 -> 64 non-bitfield */
749
754
uint8_t ub2 ; /* 20 -> 8 non-bitfield */
750
- int64_t ub7 ; /* 7 -> 64 non-bitfield signed */
751
- int64_t sb4 ; /* 4 -> 64 non-bitfield signed */
752
- uint64_t sb20 ; /* 20 -> 16 non-bitfield unsigned */
753
- int32_t u32 : 20 ; /* 32 non-bitfield -> 20 bitfield */
754
- uint64_t s32 : 60 ; /* 32 non-bitfield -> 60 bitfield */
755
+ int64_t ub7 __bpf_aligned ; /* 7 -> 64 non-bitfield signed */
756
+ int64_t sb4 __bpf_aligned ; /* 4 -> 64 non-bitfield signed */
757
+ uint64_t sb20 __bpf_aligned ; /* 20 -> 16 non-bitfield unsigned */
758
+ int32_t u32 : 20 ; /* 32 non-bitfield -> 20 bitfield */
759
+ uint64_t s32 : 60 __bpf_aligned ; /* 32 non-bitfield -> 60 bitfield */
755
760
};
756
761
757
762
struct core_reloc_bitfields___just_big_enough {
0 commit comments