]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
libbpf: Fix build errors.
authorDavid Miller <davem@davemloft.net>
Tue, 19 Dec 2017 20:53:11 +0000 (15:53 -0500)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 20 Dec 2017 00:33:25 +0000 (01:33 +0100)
These elf object pieces are of type Elf64_Xword and therefore could be
"long long" on some builds.

Cast to "long long" and use printf format %lld to deal with this since
we are building with -Werror=format.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c

index 5b83875b359496bd7735f9d2015de77c3afc0c36..e9c4b7cabcf2090b98862207129620cdaedf86ca 100644 (file)
@@ -910,8 +910,9 @@ bpf_program__collect_reloc(struct bpf_program *prog, GElf_Shdr *shdr,
                                   GELF_R_SYM(rel.r_info));
                        return -LIBBPF_ERRNO__FORMAT;
                }
-               pr_debug("relo for %ld value %ld name %d\n",
-                        rel.r_info >> 32, sym.st_value, sym.st_name);
+               pr_debug("relo for %lld value %lld name %d\n",
+                        (long long) (rel.r_info >> 32),
+                        (long long) sym.st_value, sym.st_name);
 
                if (sym.st_shndx != maps_shndx && sym.st_shndx != text_shndx) {
                        pr_warning("Program '%s' contains non-map related relo data pointing to section %u\n",