binutils-gdb/ld/testsuite
Jose E. Marchesi d218e7fedc DesCGENization of the BPF binutils port
CGEN is cool, but the BPF architecture is simply too bizarre for it.

The weird way of BPF to handle endianness in instruction encoding, the
weird C-like alternative assembly syntax, the weird abuse of
multi-byte (or infra-byte) instruction fields as opcodes, the unusual
presence of opcodes beyond the first 32-bits of some instructions, are
all examples of what makes it a PITA to continue using CGEN for this
port.  The bpf.cpu file is becoming so complex and so nested with
p-macros that it is very difficult to read, and quite challenging to
update.  Also, every time we are forced to change something in CGEN to
accommodate BPF requirements (which is often) we have to do extensive
testing to make sure we do not break any other target using CGEN.

This is getting un-maintenable.

So I have decided to bite the bullet and revamp/rewrite the port so it
no longer uses CGEN.  Overall, this involved:

* To remove the cpu/bpf.{cpu,opc} descriptions.

* To remove the CGEN generated files.

* To replace the CGEN generated opcodes table with a new hand-written
  opcodes table for BPF.

* To replace the CGEN generated disassembler wih a new disassembler
  that uses the new opcodes.

* To replace the CGEN generated assembler with a new assembler that uses the
  new opcodes.

* To replace the CGEN generated simulator with a new simulator that uses the
  new opcodes. [This is pushed in GDB in another patch.]

* To adapt the build systems to the new situation.

Additionally, this patch introduces some extensions and improvements:

* A new BPF relocation BPF_RELOC_BPF_DISP16 plus corresponding ELF
  relocation R_BPF_GNU_64_16 are added to the BPF BFD port.  These
  relocations are used for section-relative 16-bit offsets used in
  load/store instructions.

* The disassembler now has support for the "pseudo-c" assembly syntax of
  BPF.  What dialect to use when disassembling is controlled by a command
  line option.

* The disassembler now has support for dumping instruction immediates in
  either octal, hexadecimal or decimal.  The used output base is controlled
  by a new command-line option.

* The GAS BPF test suite has been re-structured and expanded in order to
  test the disassembler pseudoc syntax support.  Minor bugs have been also
  fixed there.  The assembler generic tests that were disabled for bpf-*-*
  targets due to the previous implementation of pseudoc syntax are now
  re-enabled.  Additional tests have been added to test the new features of
  the assembler.  .dump files are no longer used.

* The linker BPF test suite has been adapted to the command line options
  used by the new disassembler.

The result is very satisfactory.  This patchs adds 3448 lines of code
and removes 10542 lines of code.

Tested in:

* Target bpf-unknown-none with 64-bit little-endian host and 32-bit
  little-endian host.

* Target x86-64-linux-gnu with --enable-targets=all

Note that I have not tested in a big-endian host yet.  I will do so
once this lands upstream so I can use the GCC compiler farm.

I have not included ChangeLog entries in this patch: these would be
massive and not very useful, considering this is pretty much a rewrite
of the port.  I beg the indulgence of the global maintainers.
2023-07-21 12:20:40 +02:00
..
config Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-aarch64 sframe: bfd: gas: ld: format bump to SFrame version 2 2023-06-29 16:31:58 -07:00
ld-alpha Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-arc arc: Update ARC specific linker tests. 2023-04-13 11:21:01 +03:00
ld-arm arm32: Fix rodata-merge-map 2023-01-20 14:58:04 +01:00
ld-auto-import Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-avr Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-bootstrap ld: Add -z nosectionheader test to bootstrap.exp 2023-06-29 10:29:47 -07:00
ld-bpf DesCGENization of the BPF binutils port 2023-07-21 12:20:40 +02:00
ld-cdtest Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-checks Both FAIL and PASS "check sections 2"? 2023-02-21 16:21:42 +10:30
ld-cris PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-crx Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-csky Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-ctf Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-cygwin Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-d10v Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-discard Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-dynamic Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-elf PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-elfcomm Add extra linker warning message about discrepancies between normal and common symbols. 2023-06-07 14:30:13 +01:00
ld-elfvers Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-elfweak obsolete target tidy 2023-01-02 14:03:22 +10:30
ld-fastcall Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-frv Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-gc Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-h8300 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-i386 PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-ia64 PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-ifunc Skip ld/pr23169 test on arm. 2023-01-09 16:51:57 +01:00
ld-libs ld-libs test on alpha-vms 2023-02-21 16:21:25 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-loongarch-elf opcodes/loongarch: do not print hex notation for signed immediates 2023-06-30 10:18:01 +08:00
ld-m68hc11 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-m68k Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-mep Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-metag Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-mips-elf Revert "MIPS: fix r6 testsuites" 2023-06-15 04:45:03 +01:00
ld-misc Re: Add some expected failures for bfin linker tests 2023-06-15 11:45:03 +09:30
ld-mmix Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-mn10300 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-msp430-elf objdump -D of bss sections and -s with -j 2023-02-11 16:43:54 +10:30
ld-nds32 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-nios2 Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-or1k Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-pdp11 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-pe ld: Sort section contributions in PDB files 2023-02-28 00:28:26 +00:00
ld-pie Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-plugin PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-powerpc Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-pru Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-riscv-elf RISC-V: Support subtraction of .uleb128. 2023-05-19 16:24:10 +08:00
ld-s12z Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-s390 IBM zSystems: Fix offset relative to static TLS 2023-01-10 14:34:16 +01:00
ld-scripts Revert "MIPS: fix -gnuabi64 testsuite" 2023-06-15 04:45:03 +01:00
ld-selective Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-sframe Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-sh Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-shared Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-size Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-sparc Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-spu objdump -D of bss sections and -s with -j 2023-02-11 16:43:54 +10:30
ld-srec Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-tic6x Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-undefined PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-unique Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-v850 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-visium Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-vsb Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-x86-64 PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
ld-xstormy16 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-xtensa bfd: xtensa: fix __stop_SECTION literal drop 2023-02-23 10:48:16 +00:00
ld-z8k Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ld-z80 Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
lib ld testsuite CFLAGS_FOR_TARGET 2023-03-29 12:56:46 +10:30
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303