[v6,0/3] Add support for nanoMIPS architecture

Message ID 20230510141829.2748105-1-aleksandar.rikalo@syrmia.com
Headers
Series Add support for nanoMIPS architecture |

Message

Aleksandar Rikalo May 10, 2023, 2:18 p.m. UTC
  This series introduces a subset of nanoMIPS functionalities. It's a pre-requirement for nanoMIPS support for GDB/SIM.

Almost complete series is a "green patch" - it adds things, so the probability of making regressions of existing functionalities is minimal.

Compared to the previous series version (v5), there are no functional impacts but changes are split into smaller parts.
Patches can be safely merged one at a time while respecting the existing order.

Aleksandar Rikalo (3):
  BFD changes for nanoMIPS support
  Opcodes changes for nanoMIPS support
  Readelf for nanoMIPS

 bfd/Makefile.am            |   19 +
 bfd/Makefile.in            |   22 +
 bfd/archures.c             |    5 +
 bfd/bfd-in2.h              |   74 ++
 bfd/config.bfd             |    6 +
 bfd/configure              |    4 +
 bfd/configure.ac           |    4 +
 bfd/cpu-nanomips.c         |   61 ++
 bfd/elf-bfd.h              |    1 +
 bfd/elfnn-nanomips.c       | 1423 ++++++++++++++++++++++++++++++++++
 bfd/elfxx-mips.h           |    5 +
 bfd/elfxx-nanomips.c       |  794 +++++++++++++++++++
 bfd/elfxx-nanomips.h       |   54 ++
 bfd/libbfd.h               |   69 ++
 bfd/reloc.c                |  140 ++++
 bfd/targets.c              |   11 +
 binutils/readelf.c         |  502 +++++++++++-
 include/dis-asm.h          |   11 +
 include/elf/common.h       |    2 +-
 include/elf/nanomips.h     |  262 +++++++
 include/opcode/nanomips.h  | 1453 +++++++++++++++++++++++++++++++++++
 opcodes/Makefile.am        |    2 +
 opcodes/Makefile.in        |   10 +
 opcodes/configure          |    1 +
 opcodes/configure.ac       |    1 +
 opcodes/dis-buf.c          |    9 +
 opcodes/dis-init.c         |    1 +
 opcodes/disassemble.c      |   13 +
 opcodes/nanomips-dis.c     | 1466 ++++++++++++++++++++++++++++++++++++
 opcodes/nanomips-formats.h |  265 +++++++
 opcodes/nanomips-opc.c     | 1073 ++++++++++++++++++++++++++
 31 files changed, 7761 insertions(+), 2 deletions(-)
 create mode 100644 bfd/cpu-nanomips.c
 create mode 100644 bfd/elfnn-nanomips.c
 create mode 100644 bfd/elfxx-nanomips.c
 create mode 100644 bfd/elfxx-nanomips.h
 create mode 100644 include/elf/nanomips.h
 create mode 100644 include/opcode/nanomips.h
 create mode 100644 opcodes/nanomips-dis.c
 create mode 100644 opcodes/nanomips-formats.h
 create mode 100644 opcodes/nanomips-opc.c
  

Comments

Tsing May 18, 2023, 10:34 a.m. UTC | #1
Hi.

I can confirm these patches can compile and could be run normally.
But the tests were omitted in this patch, so I could not confirm if the patches work.
Do we need to add `#define ARCH_nanomips` in the front part like the official one? 
If so, definitions of `ARCH_nanomips` should be added in the `opcodes/disassemble.c` file.
 
Comparing with the patch v5, I can see you have deleted the file `include/elf/mips-common.h`
and moved its main contents to `include/elf/nanomips.h`. This should be fine, 
but in my opinion, the two FIXMEs in file `opcodes/nanomips-dis.c` should be kept:
"/* FIXME: These should be shared with gdb somehow. */" and
"/* FIXME: Should probably use a hash table on the major opcode here. */" 
as these behaviors were not fixed.

Thanks.
Tsing

>This series introduces a subset of nanoMIPS functionalities. It's a pre-requirement for nanoMIPS support for GDB/SIM.
>
>Almost complete series is a "green patch" - it adds things, so the probability of making regressions of existing functionalities is minimal.
>
>Compared to the previous series version (v5), there are no functional impacts but changes are split into smaller parts.