David Miller <da...@davemloft.net> writes: > From: Aaron Conole <acon...@bytheb.org> > Date: Fri, 28 Apr 2017 11:57:36 -0400 > >> I'll get an arm board up and running to do some testing there. As a >> teaser: > > Great. > > I started working on some more relocation stuff, so more of the > generic gas tests pass. > > For example, stuff like this now works properly: > > [davem@dhcp-10-15-49-210 build-bpf]$ cat gas/y.s > .data > .globl foo > foo: .xword bar > [davem@dhcp-10-15-49-210 build-bpf]$ gas/as-new -o gas/y.o gas/y.s > [davem@dhcp-10-15-49-210 build-bpf]$ binutils/objdump -r gas/y.o > > gas/y.o: file format elf64-bpfle > > RELOCATION RECORDS FOR [.data]: > OFFSET TYPE VALUE > 0000000000000000 R_BPF_DATA_64 bar > > > [davem@dhcp-10-15-49-210 build-bpf]$ > > It turned out that I needed to separate the R_BPF_* relocations into > data vs. insn ones. > > Another idea I am thinking about pursuing is adding BPF simulator > support under sim/ so that people can use gdb to step through BPF > programs. > > I hope we can make it work in a way that we can even step through > XDP programs and feed them simple test packets, stuff like that. > > Anyways, quick relative live patch against v2 from my tree for the > reloc stuff: > > diff --git a/bfd/elf64-bpf.c b/bfd/elf64-bpf.c > index 9944bb4..1be285d 100644 > --- a/bfd/elf64-bpf.c > +++ b/bfd/elf64-bpf.c > @@ -1,8 +1,89 @@ > #include "sysdep.h" > #include "bfd.h" > +#include "bfdlink.h" > #include "libbfd.h" > +#include "libiberty.h" > #include "elf-bfd.h" > +#include "elf/bpf.h" > #include "opcode/bpf.h" > +#include "objalloc.h" > +#include "elf64-bpf.h"
I get a compile error here. I guess this file wasn't included.