github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/btf/testdata/relocs_read_tgt.c (about)

     1  /*
     2  	This file exists to emit ELFs with specific BTF types to use as target BTF
     3  	in tests. It can be made redundant when btf.Spec can be handcrafted and
     4  	passed as a CO-RE target in the future.
     5  */
     6  
     7  struct s {
     8  	char a;
     9  	char b;
    10  };
    11  
    12  struct s *unused_s __attribute__((unused));
    13  
    14  typedef unsigned int my_u32;
    15  typedef unsigned char u8;
    16  typedef unsigned short u16;
    17  typedef unsigned int u32;
    18  typedef unsigned long u64;
    19  
    20  struct bits {
    21  	/*int x;*/
    22  	u8 b : 2, a : 4; /* a was before b */
    23  	my_u32 d : 2; /* was 'unsigned int' */
    24  	u16 c : 1; /* was before d */
    25  	enum { ZERO = 0, ONE = 1 } e : 1;
    26  	u16 f; /* was: u64 f:16 */
    27  	u32 g : 30; /* was: u64 g:30 */
    28  };
    29  
    30  struct bits *unused_bits __attribute__((unused));