From: Joe Stringer Date: Wed, 28 Feb 2018 22:16:42 +0000 (-0800) Subject: bpf: Print section name when hitting non ld64 issue X-Git-Tag: v4.16.0~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0405444f7614d9dd76cb9fb1b7a696cab5059ba;p=thirdparty%2Fiproute2.git bpf: Print section name when hitting non ld64 issue It's useful to be able to tell which section is being processed in the ELF when this error is triggered, so print that detail. Signed-off-by: Joe Stringer Acked-by: Daniel Borkmann Signed-off-by: Stephen Hemminger --- diff --git a/lib/bpf.c b/lib/bpf.c index 2db151e4d..c38d92d87 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -2039,6 +2039,7 @@ static int bpf_apply_relo_data(struct bpf_elf_ctx *ctx, insns[ioff].code != (BPF_LD | BPF_IMM | BPF_DW)) { fprintf(stderr, "ELF contains relo data for non ld64 instruction at offset %u! Compiler bug?!\n", ioff); + fprintf(stderr, " - Current section: %s\n", data_relo->sec_name); if (ioff < num_insns && insns[ioff].code == (BPF_JMP | BPF_CALL)) fprintf(stderr, " - Try to annotate functions with always_inline attribute!\n");