Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-05-01 Thread Alexei Starovoitov
On 5/1/17 8:03 PM, David Miller wrote: From: Alexei Starovoitov Date: Mon, 1 May 2017 19:49:21 -0700 On 4/30/17 11:21 AM, David Miller wrote: built with: clang -O2 -target bpfel -g -c x.c -o x.o readelf can see it just fine: [davem@localhost binutils]$ ./readelf

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-05-01 Thread David Miller
From: Alexei Starovoitov Date: Mon, 1 May 2017 19:49:21 -0700 > On 4/30/17 11:21 AM, David Miller wrote: >> built with: >> >> clang -O2 -target bpfel -g -c x.c -o x.o >> >> readelf can see it just fine: >> >> [davem@localhost binutils]$ ./readelf --debug-dump=loc ./xel.o >>

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-05-01 Thread Alexei Starovoitov
On 4/30/17 11:21 AM, David Miller wrote: built with: clang -O2 -target bpfel -g -c x.c -o x.o readelf can see it just fine: [davem@localhost binutils]$ ./readelf --debug-dump=loc ./xel.o Contents of the .debug_loc section: Offset BeginEnd Expression

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-30 Thread David Miller
From: Alexei Starovoitov Date: Sat, 29 Apr 2017 23:44:59 -0700 > '-g' still doesn't seem to work: > /w/binutils-gdb/bld/binutils/objdump: invalid relocation type 10 > /w/binutils-gdb/bld/binutils/objdump: BFD (GNU Binutils) > 2.28.51.20170429 assertion fail ../../bfd/elf64-bpf.c:139

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-30 Thread David Miller
From: Alexei Starovoitov Date: Sat, 29 Apr 2017 23:44:59 -0700 > On 4/29/17 7:37 PM, David Miller wrote: >> BTW, should I just remove tailcall from the opcode table altogether? > > yeah. tailcall is not a special opcode from user space point of view. > Only after normal call with

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-30 Thread David Miller
From: Alexei Starovoitov Date: Sat, 29 Apr 2017 23:44:59 -0700 > On 4/29/17 7:37 PM, David Miller wrote: >> From: David Miller >> Date: Sat, 29 Apr 2017 22:24:50 -0400 (EDT) >> >>> Some of your bugs should be fixed by this patch below, I'll add >>> test cases

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-30 Thread Alexei Starovoitov
On 4/29/17 7:37 PM, David Miller wrote: From: David Miller Date: Sat, 29 Apr 2017 22:24:50 -0400 (EDT) Some of your bugs should be fixed by this patch below, I'll add test cases soon: Ok, here are all the local changes in my tree. I made the relocs match LLVM and I

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-29 Thread David Miller
From: David Miller Date: Sat, 29 Apr 2017 22:24:50 -0400 (EDT) > Some of your bugs should be fixed by this patch below, I'll add > test cases soon: Ok, here are all the local changes in my tree. I made the relocs match LLVM and I fixed some dwarf debugging stuff. With

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-29 Thread Alexei Starovoitov
On 4/29/17 7:13 PM, David Miller wrote: From: Alexei Starovoitov Date: Sat, 29 Apr 2017 17:48:43 -0700 /w/binutils-gdb/bld/binutils/objdump: invalid relocation type 10 /w/binutils-gdb/bld/binutils/objdump: Dwarf Error: found address size I discussed this in another email, the

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-29 Thread David Miller
From: Alexei Starovoitov Date: Sat, 29 Apr 2017 17:48:43 -0700 > $ bld/binutils/objdump -S test.o > > test.o: file format elf64-bpfbe > > Disassembly of section .text: > > : >0: 18 10 00 00 83 98 47 39 ldimm64 r1, 590618314553 >8: 00 00 00 00

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-29 Thread David Miller
From: Alexei Starovoitov Date: Sat, 29 Apr 2017 17:48:43 -0700 > /w/binutils-gdb/bld/binutils/objdump: invalid relocation type 10 > /w/binutils-gdb/bld/binutils/objdump: Dwarf Error: found address size I discussed this in another email, the relocation numbers I used in binutils do

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-29 Thread David Miller
From: Alexei Starovoitov Date: Sat, 29 Apr 2017 17:48:43 -0700 > On 4/28/17 1:33 PM, David Miller wrote: >> New in this version: >> >> 1) All the relocation work I posted earlier today. >> 2) Teach readelf about a few bpf relocs as needed >> 3) Add a 'nop' instruction which

Re: [PATCH v3 binutils] Add BPF support to binutils...

2017-04-29 Thread Alexei Starovoitov
On 4/28/17 1:33 PM, David Miller wrote: New in this version: 1) All the relocation work I posted earlier today. 2) Teach readelf about a few bpf relocs as needed 3) Add a 'nop' instruction which facilitates the gas testsuite. I used "mov r0,r0" The whole gas testsuite passes now. :-) But

[PATCH v3 binutils] Add BPF support to binutils...

2017-04-28 Thread David Miller
New in this version: 1) All the relocation work I posted earlier today. 2) Teach readelf about a few bpf relocs as needed 3) Add a 'nop' instruction which facilitates the gas testsuite. I used "mov r0,r0" The whole gas testsuite passes now. :-) But that just means we have to add more tests