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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/30/17 9:07 AM, David Miller wrote:
This is mainly a synchronization point, I still need to look
more deeply into Alexei's -g issue.

New in this version from v3:
 - Remove tailcall from opcode table
 - Rearrange relocations so that numbers match with LLVM ones
 - Emit relocs properly so that dwarf2 debug info tests pass
 - Handle negative load/store offsets properly, add tests

Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>

dwarf on little endian works now :)

$ /w/binutils-gdb/bld/binutils/objdump -S test.o

test.o:     file format elf64-bpfle

Disassembly of section .text:

0000000000000000 <bpf_prog1>:
int bpf_prog1(void *ign)
{
  volatile unsigned long t = 0x8983984739ull;
   0:	18 01 00 00 39 47 98 83 	ldimm64	r0, 590618314553
   8:	00 00 00 00 89 00 00 00
  10:	7b 1a f8 ff 00 00 00 00 	stdw	[r1+-8], r10
  return *(unsigned long *)((0xffffffff8fff0002ull) + t);
  18:	79 a1 f8 ff 00 00 00 00 	lddw	r10, [r1+-8]

This is great milestone.

Also I finally figured out how to enable native+bpf:
../configure --enable-targets=bpf-elf,x86_64-elf

having support for both in one binary is a big deal :)

Only 'gdb' warns with dual arch support:
"
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB.  Attempting to continue with the default bpf settings.
"

(gdb) x/10i bpf_prog1
   0x0 <bpf_prog1>:	ldimm64	r0, 590618314553
   0x10 <bpf_prog1+16>:	stdw	[r1+-8], r10
   0x18 <bpf_prog1+24>:	lddw	r10, [r1+-8]
   0x20 <bpf_prog1+32>:	add	r0, -1879113726
   0x28 <bpf_prog1+40>:	lddw	r1, [r0+0]
   0x30 <bpf_prog1+48>:	exit
   0x38:	Cannot access memory at address 0x38

the last line also seems wrong. Off by 1 error?




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux