From 3c9b82baee30a1d3cfeb419643c6363dc9267208 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 25 Oct 2005 17:40:19 +0000 Subject: Add support for the Z80 processor family --- include/coff/ChangeLog | 5 +++++ include/coff/internal.h | 6 +++++- include/coff/z80.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 include/coff/z80.h (limited to 'include/coff') diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog index ca201a1..a8b66cc 100644 --- a/include/coff/ChangeLog +++ b/include/coff/ChangeLog @@ -1,3 +1,8 @@ +2005-10-25 Arnold Metselaar + + * internal.h: Add relocation number for Z80 + * z80.h: New file. + 2005-08-18 Alan Modra * a29k.h: Delete. diff --git a/include/coff/internal.h b/include/coff/internal.h index 20e06c2..d7a8381 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -1,7 +1,7 @@ /* Internal format of COFF object file data structures, for GNU BFD. This file is part of BFD, the Binary File Descriptor library. - Copyright 1999, 2000, 2001, 2002, 2003, 2004 + Copyright 1999, 2000, 2001, 2002, 2003, 2004. 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -715,6 +715,10 @@ struct internal_reloc #define R_IMM4H 0x24 /* high nibble */ #define R_DISP7 0x25 /* djnz displacement */ +/* Z80 modes */ +#define R_OFF8 0x32 /* 8 bit signed abs, for (i[xy]+d) */ +/* R_JR, R_IMM8, R_IMM16, R_IMM32 - as for Z8k */ + /* H8500 modes */ #define R_H8500_IMM8 1 /* 8 bit immediate */ diff --git a/include/coff/z80.h b/include/coff/z80.h new file mode 100644 index 0000000..3c72c10 --- /dev/null +++ b/include/coff/z80.h @@ -0,0 +1,51 @@ +/* coff information for Zilog Z80 + Copyright 2005 Free Software Foundation, Inc. + Contributed by Arnold Metselaar + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#define L_LNNO_SIZE 4 +#include "coff/external.h" + +/* z80 backend does not use dots in section names. */ +#undef _TEXT +#define _TEXT "text" +#undef _DATA +#define _DATA "data" +#undef _BSS +#define _BSS "bss" + +/* Type of cpu is stored in flags. */ +#define F_MACHMASK 0xF000 + +#define Z80MAGIC 0x805A + +#define Z80BADMAG(x) (((x).f_magic != Z80MAGIC)) + +/* Relocation directives. */ + +/* This format actually has more bits than we need. */ + +struct external_reloc +{ + char r_vaddr[4]; + char r_symndx[4]; + char r_offset[4]; + char r_type[2]; + char r_stuff[2]; +}; + +#define RELOC struct external_reloc +#define RELSZ 16 -- cgit v1.1