binutils-gdb/include/elf/z80.h
Sergey Belyashov 9fc0b501af Add support for the GBZ80 and Z80N variants of the Z80 architecture, and add DWARF debug info support to the Z80 assembler.
PR 25469
bfd	* archures.c: Add GBZ80 and Z80N machine values.
	* reloc.c: Add BFD_RELOC_Z80_16_BE.
	* coff-z80.c: Add support for new reloc.
	* coffcode.h: Add support for new machine values.
	* cpu-z80.c: Add support for new machine names.
	* elf32-z80.c: Add support for new reloc.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

binutils* readelf.c (get_machine_flags): Add support for Z80N machine
	number.

gas	* config/tc-z80.c: Add -gbz80 command line option to generate code
	for the GameBoy Z80.  Add support for generating DWARF.
	* config/tc-z80.h: Add support for DWARF debug information
	generation.
	* doc/c-z80.texi: Document new command line option.
	* testsuite/gas/z80/gbz80_all.d: New file.
	* testsuite/gas/z80/gbz80_all.s: New file.
	* testsuite/gas/z80/z80.exp: Run the new tests.
	* testsuite/gas/z80/z80n_all.d: New file.
	* testsuite/gas/z80/z80n_all.s: New file.
	* testsuite/gas/z80/z80n_reloc.d: New file.

include	* coff/internal.h (R_IMM16BE): Define.
	* elf/z80.h (EF_Z80_MACH_Z80N): Define.
	(R_Z80_16_BE): New reloc.

ld	* emulparams/elf32z80.sh: Use z80 emulation.
	* emultempl/z80.em: Make generic to both COFF and ELF Z80 emulations.
	* emultempl/z80elf.em: Delete.
	* testsuite/ld-elf/pr22450.d: Expect to fail for the Z80.
	* testsuite/ld-elf/sec64k.exp: Fix Z80 assembly.
	* testsuite/ld-unique/pr21529.s: Avoid register name conflict.
	* testsuite/ld-unique/unique.s: Likewise.
	* testsuite/ld-unique/unique_empty.s: Likewise.
	* testsuite/ld-unique/unique_shared.s: Likewise.
	* testsuite/ld-unique/unique.d: Updated expected output.
	* testsuite/ld-z80/arch_z80n.d: New file.
	* testsuite/ld-z80/comb_arch_z80_z80n.d: New file.
	* testsuite/ld-z80/labels.s: Add more labels.
	* testsuite/ld-z80/relocs.s: Add more reloc tests.
	* testsuite/ld-z80/relocs_f_z80n.d: New file

opcodes	* z80-dis.c: Add support for GBZ80 opcodes.
2020-02-07 14:53:46 +00:00

55 lines
1.9 KiB
C

/* Z80 ELF support for BFD.
Copyright (C) 1999-2019 Free Software Foundation, Inc.
Contributed by Sergey Belyashov <sergey.belyashov@gmail.com>
This file is part of BFD, the Binary File Descriptor library.
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 3 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,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _ELF_Z80_H
#define _ELF_Z80_H
#include "elf/reloc-macros.h"
/* Processor specific flags for the ELF header e_flags field. */
#define EF_Z80_MACH_Z80 0x01
#define EF_Z80_MACH_Z180 0x02
#define EF_Z80_MACH_R800 0x03
#define EF_Z80_MACH_EZ80_Z80 0x04
#define EF_Z80_MACH_EZ80_ADL 0x84
#define EF_Z80_MACH_GBZ80 0x05
#define EF_Z80_MACH_Z80N 0x06
#define EF_Z80_MACH_MSK 0xff
/* Relocations. */
START_RELOC_NUMBERS (elf_z80_reloc_type)
RELOC_NUMBER (R_Z80_NONE, 0)
RELOC_NUMBER (R_Z80_8, 1)
RELOC_NUMBER (R_Z80_8_DIS, 2)
RELOC_NUMBER (R_Z80_8_PCREL, 3)
RELOC_NUMBER (R_Z80_16, 4)
RELOC_NUMBER (R_Z80_24, 5)
RELOC_NUMBER (R_Z80_32, 6)
RELOC_NUMBER (R_Z80_BYTE0, 7)
RELOC_NUMBER (R_Z80_BYTE1, 8)
RELOC_NUMBER (R_Z80_BYTE2, 9)
RELOC_NUMBER (R_Z80_BYTE3, 10)
RELOC_NUMBER (R_Z80_WORD0, 11)
RELOC_NUMBER (R_Z80_WORD1, 12)
RELOC_NUMBER (R_Z80_16_BE, 13)
END_RELOC_NUMBERS (R_Z80_max)
#endif /* _ELF_Z80_H */