]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bpf: Print section name when hitting non ld64 issue
authorJoe Stringer <joe@wand.net.nz>
Wed, 28 Feb 2018 22:16:42 +0000 (14:16 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Mar 2018 21:28:53 +0000 (13:28 -0800)
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 <joe@wand.net.nz>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/bpf.c

index 2db151e4dd3c4cc23a09a8e1c90c960337b9b77f..c38d92d877594c3fd01e5665bf2143a04558a811 100644 (file)
--- 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");