1. 02 Dec, 2021 21 commits
  2. 01 Dec, 2021 2 commits
  3. 30 Nov, 2021 15 commits
  4. 29 Nov, 2021 2 commits
    • Alan Maguire's avatar
      libbpf: Silence uninitialized warning/error in btf_dump_dump_type_data · 43174f0d
      Alan Maguire authored
      When compiling libbpf with gcc 4.8.5, we see:
      
        CC       staticobjs/btf_dump.o
      btf_dump.c: In function ‘btf_dump_dump_type_data.isra.24’:
      btf_dump.c:2296:5: error: ‘err’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        if (err < 0)
           ^
      cc1: all warnings being treated as errors
      make: *** [staticobjs/btf_dump.o] Error 1
      
      While gcc 4.8.5 is too old to build the upstream kernel, it's possible it
      could be used to build standalone libbpf which suffers from the same problem.
      Silence the error by initializing 'err' to 0.  The warning/error seems to be
      a false positive since err is set early in the function.  Regardless we
      shouldn't prevent libbpf from building for this.
      
      Fixes: 920d16af ("libbpf: BTF dumper support for typed data")
      Signed-off-by: default avatarAlan Maguire <alan.maguire@oracle.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/1638180040-8037-1-git-send-email-alan.maguire@oracle.com
      43174f0d
    • Andrii Nakryiko's avatar
      Merge branch 'Support static initialization of BPF_MAP_TYPE_PROG_ARRAY' · da61e9e3
      Andrii Nakryiko authored
      Hengqi Chen says:
      
      ====================
      
      Make libbpf support static initialization of BPF_MAP_TYPE_PROG_ARRAY
      with a syntax similar to map-in-map initialization:
      
          SEC("socket")
          int tailcall_1(void *ctx)
          {
              return 0;
          }
      
          struct {
              __uint(type, BPF_MAP_TYPE_PROG_ARRAY);
              __uint(max_entries, 2);
              __uint(key_size, sizeof(__u32));
              __array(values, int (void *));
          } prog_array_init SEC(".maps") = {
              .values = {
                  [1] = (void *)&tailcall_1,
              },
          };
      
      v1->v2:
        - Add stricter checks on relos collect, some renamings (Andrii)
        - Update selftest to check tailcall result (Andrii)
      ====================
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      da61e9e3