aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorSergey Belyashov <sergey.belyashov@gmail.com>2020-01-02 14:10:40 +0000
committerNick Clifton <nickc@redhat.com>2020-01-02 14:14:59 +0000
commit6655dba246bd164d953fe220a0e3d4eed85bb268 (patch)
tree423258b5dadb447dc649e71c6ce48aaeed8ba385 /binutils/readelf.c
parent0db131fb835e4c4f6a024e86743467e7e01c965e (diff)
downloadgdb-6655dba246bd164d953fe220a0e3d4eed85bb268.zip
gdb-6655dba246bd164d953fe220a0e3d4eed85bb268.tar.gz
gdb-6655dba246bd164d953fe220a0e3d4eed85bb268.tar.bz2
Add support for the GBZ80, Z180, and eZ80 variants of the Z80 architecure. Add an ELF based target for these as well.
PR 25224 bfd * Makefile.am: Add z80-elf target support. * configure.ac: Likewise. * targets.c: Likewise. * config.bfd: Add z80-elf target support and new arches: ez80 and z180. * elf32-z80.c: New file. * archures.c: Add new z80 architectures: eZ80 and Z180. * coffcode.h: Likewise. * cpu-z80.c: Likewise. * bfd-in2.h: Likewise plus additional Z80 relocations. * coff-z80.c: Add new relocations for Z80 target and local label check. gas * config/tc-z80.c: Add new architectures: Z180 and eZ80. Add support for assembler code generated by SDCC. Add new relocation types. Add z80-elf target support. * config/tc-z80.h: Add z80-elf target support. Enable dollar local labels. Local labels starts from ".L". * testsuite/gas/all/fwdexp.d: Fix failure due to symbol conflict. * testsuite/gas/all/fwdexp.s: Likewise. * testsuite/gas/z80/suffix.d: Fix failure on ELF target. * testsuite/gas/z80/z80.exp: Add new tests * testsuite/gas/z80/dollar.d: New file. * testsuite/gas/z80/dollar.s: New file. * testsuite/gas/z80/ez80_adl_all.d: New file. * testsuite/gas/z80/ez80_adl_all.s: New file. * testsuite/gas/z80/ez80_adl_suf.d: New file. * testsuite/gas/z80/ez80_isuf.s: New file. * testsuite/gas/z80/ez80_z80_all.d: New file. * testsuite/gas/z80/ez80_z80_all.s: New file. * testsuite/gas/z80/ez80_z80_suf.d: New file. * testsuite/gas/z80/r800_extra.d: New file. * testsuite/gas/z80/r800_extra.s: New file. * testsuite/gas/z80/r800_ii8.d: New file. * testsuite/gas/z80/r800_z80_doc.d: New file. * testsuite/gas/z80/z180.d: New file. * testsuite/gas/z80/z180.s: New file. * testsuite/gas/z80/z180_z80_doc.d: New file. * testsuite/gas/z80/z80_doc.d: New file. * testsuite/gas/z80/z80_doc.s: New file. * testsuite/gas/z80/z80_ii8.d: New file. * testsuite/gas/z80/z80_ii8.s: New file. * testsuite/gas/z80/z80_in_f_c.d: New file. * testsuite/gas/z80/z80_in_f_c.s: New file. * testsuite/gas/z80/z80_op_ii_ld.d: New file. * testsuite/gas/z80/z80_op_ii_ld.s: New file. * testsuite/gas/z80/z80_out_c_0.d: New file. * testsuite/gas/z80/z80_out_c_0.s: New file. * testsuite/gas/z80/z80_reloc.d: New file. * testsuite/gas/z80/z80_reloc.s: New file. * testsuite/gas/z80/z80_sli.d: New file. * testsuite/gas/z80/z80_sli.s: New file. ld * Makefile.am: Add new target z80-elf * configure.tgt: Likewise. * emultempl/z80.em: Add support for eZ80 and Z180 architectures. * emulparams/elf32z80.sh: New file. * emultempl/z80elf.em: Likewise. * testsuite/ld-z80/arch_ez80_adl.d: Likewise. * testsuite/ld-z80/arch_ez80_z80.d: Likewise. * testsuite/ld-z80/arch_r800.d: Likewise. * testsuite/ld-z80/arch_z180.d: Likewise. * testsuite/ld-z80/arch_z80.d: Likewise. * testsuite/ld-z80/comb_arch_ez80_z80.d: Likewise. * testsuite/ld-z80/comb_arch_z180.d: Likewise. * testsuite/ld-z80/labels.s: Likewise. * testsuite/ld-z80/relocs.s: Likewise. * testsuite/ld-z80/relocs_b_ez80.d: Likewise. * testsuite/ld-z80/relocs_b_z80.d: Likewise. * testsuite/ld-z80/relocs_f_z80.d: Likewise. * testsuite/ld-z80/z80.exp: Likewise. opcodes * z80-dis.c: Add support for eZ80 and Z80 instructions.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index fab503d..17c27ce 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -162,6 +162,7 @@
#include "elf/xgate.h"
#include "elf/xstormy16.h"
#include "elf/xtensa.h"
+#include "elf/z80.h"
#include "getopt.h"
#include "libiberty.h"
@@ -1586,6 +1587,10 @@ dump_relocations (Filedata * filedata,
else
rtype = elf_nfp_reloc_type (type);
break;
+
+ case EM_Z80:
+ rtype = elf_z80_reloc_type (type);
+ break;
}
if (rtype == NULL)
@@ -3751,6 +3756,21 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
if (e_flags & ~ EF_MSP430_MACH)
strcat (buf, _(": unknown extra flag bits also present"));
+ break;
+
+ case EM_Z80:
+ switch (e_flags & EF_Z80_MACH_MSK)
+ {
+ case EF_Z80_MACH_Z80: strcat (buf, ", Z80"); break;
+ case EF_Z80_MACH_Z180: strcat (buf, ", Z180"); break;
+ case EF_Z80_MACH_R800: strcat (buf, ", R800"); break;
+ case EF_Z80_MACH_EZ80_Z80: strcat (buf, ", EZ80"); break;
+ case EF_Z80_MACH_EZ80_ADL: strcat (buf, ", EZ80, ADL"); break;
+ case EF_Z80_MACH_GBZ80: strcat (buf, ", GBZ80"); break;
+ default:
+ strcat (buf, _(", unknown")); break;
+ }
+ break;
}
}
@@ -12722,6 +12742,8 @@ is_32bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
case EM_XTENSA_OLD:
case EM_XTENSA:
return reloc_type == 1; /* R_XTENSA_32. */
+ case EM_Z80:
+ return reloc_type == 6; /* R_Z80_32. */
default:
{
static unsigned int prev_warn = 0;
@@ -12904,6 +12926,8 @@ is_24bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
return reloc_type == 4; /* R_MN10200_24. */
case EM_FT32:
return reloc_type == 5; /* R_FT32_20. */
+ case EM_Z80:
+ return reloc_type == 5; /* R_Z80_24. */
default:
return FALSE;
}
@@ -12975,6 +12999,8 @@ is_16bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
return reloc_type == 2; /* R_XC16C_ABS_16. */
case EM_XGATE:
return reloc_type == 3; /* R_XGATE_16. */
+ case EM_Z80:
+ return reloc_type == 4; /* R_Z80_16. */
default:
return FALSE;
}
@@ -12990,6 +13016,8 @@ is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
{
case EM_RISCV:
return reloc_type == 54; /* R_RISCV_SET8. */
+ case EM_Z80:
+ return reloc_type == 1; /* R_Z80_8. */
default:
return FALSE;
}
@@ -13197,6 +13225,7 @@ is_none_reloc (Filedata * filedata, unsigned int reloc_type)
case EM_TI_C6000:/* R_C6000_NONE. */
case EM_X86_64: /* R_X86_64_NONE. */
case EM_XC16X:
+ case EM_Z80: /* R_Z80_NONE. */
case EM_WEBASSEMBLY: /* R_WASM32_NONE. */
return reloc_type == 0;