aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-02-10 00:58:38 +0000
committerNick Clifton <nickc@redhat.com>2001-02-10 00:58:38 +0000
commita85d7ed0f0b65504f7d8027319d1a4a9adb9d8c1 (patch)
treed46823b360b1d614fb1c65de41cdc778a68984ff /include
parent356d255deb0cb49d4dade90addbb7bdcde0d7e36 (diff)
downloadgdb-a85d7ed0f0b65504f7d8027319d1a4a9adb9d8c1.zip
gdb-a85d7ed0f0b65504f7d8027319d1a4a9adb9d8c1.tar.gz
gdb-a85d7ed0f0b65504f7d8027319d1a4a9adb9d8c1.tar.bz2
Add s390 support
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/dis-asm.h1
-rw-r--r--include/elf/ChangeLog5
-rw-r--r--include/elf/common.h4
-rw-r--r--include/elf/s390.h73
-rw-r--r--include/opcode/ChangeLog4
-rw-r--r--include/opcode/s390.h130
7 files changed, 221 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 39085a1..fa7af4b 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * dis-asm.h: Add linux target for S/390.
+
2001-01-11 Peter Targett <peter.targett@arccores.com>
* dis-asm.h (arc_get_disassembler): Correct declaration.
diff --git a/include/dis-asm.h b/include/dis-asm.h
index 5c9d8d8..6e3e3b5 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -206,6 +206,7 @@ extern int print_insn_tic54x PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_tic80 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_pj PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_avr PARAMS ((bfd_vma, disassemble_info*));
+extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*));
extern void print_arm_disassembler_options PARAMS ((FILE *));
extern void parse_arm_disassembler_option PARAMS ((char *));
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 05e73b8..ec399f1 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * common.h: Add linux target for S/390.
+ * s390.h: New file.
+
2001-01-11 Peter Targett <peter.targett@arccores.com>
* arc.h (E_ARC_MACH_ARC5, E_ARC_MACH_ARC6, E_ARC_MACH_ARC7,
diff --git a/include/elf/common.h b/include/elf/common.h
index d127b9c..991e57e 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -114,6 +114,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define EM_960 19 /* Intel 80960 */
#define EM_PPC 20 /* PowerPC */
#define EM_PPC64 21 /* 64-bit PowerPC */
+#define EM_S390 22 /* IBM S/390 */
#define EM_V800 36 /* NEC V800 series */
#define EM_FR20 37 /* Fujitsu FR20 */
@@ -195,6 +196,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Alpha backend magic number. Written in the absence of an ABI. */
#define EM_ALPHA 0x9026
+/* old S/390 backend magic number. Written in the absence of an ABI. */
+#define EM_S390_OLD 0xa390
+
/* D10V backend magic number. Written in the absence of an ABI. */
#define EM_CYGNUS_D10V 0x7650
diff --git a/include/elf/s390.h b/include/elf/s390.h
new file mode 100644
index 0000000..3cd9976
--- /dev/null
+++ b/include/elf/s390.h
@@ -0,0 +1,73 @@
+/* 390 ELF support for BFD.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Carl B. Pedersen and Martin Schwidefsky.
+
+ 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 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#ifndef _ELF_390_H
+#define _ELF_390_H
+
+/* Processor specific flags for the ELF header e_flags field. */
+
+/* Symbol types. */
+
+#define STACK_REG 15 /* Global Stack reg */
+#define BACKL_REG 14 /* Global Backlink reg */
+#define BASE_REG 13 /* Global Base reg */
+#define GOT_REG 12 /* Holds addr of GOT */
+
+#include "elf/reloc-macros.h"
+
+/* Relocation types. */
+
+START_RELOC_NUMBERS (elf_s390_reloc_type)
+ RELOC_NUMBER (R_390_NONE, 0) /* No reloc. */
+ RELOC_NUMBER (R_390_8, 1) /* Direct 8 bit. */
+ RELOC_NUMBER (R_390_12, 2) /* Direct 12 bit. */
+ RELOC_NUMBER (R_390_16, 3) /* Direct 16 bit. */
+ RELOC_NUMBER (R_390_32, 4) /* Direct 32 bit. */
+ RELOC_NUMBER (R_390_PC32, 5) /* PC relative 32 bit. */
+ RELOC_NUMBER (R_390_GOT12, 6) /* 12 bit GOT offset. */
+ RELOC_NUMBER (R_390_GOT32, 7) /* 32 bit GOT offset. */
+ RELOC_NUMBER (R_390_PLT32, 8) /* 32 bit PC relative PLT address. */
+ RELOC_NUMBER (R_390_COPY, 9) /* Copy symbol at runtime. */
+ RELOC_NUMBER (R_390_GLOB_DAT, 10) /* Create GOT entry. */
+ RELOC_NUMBER (R_390_JMP_SLOT, 11) /* Create PLT entry. */
+ RELOC_NUMBER (R_390_RELATIVE, 12) /* Adjust by program base. */
+ RELOC_NUMBER (R_390_GOTOFF, 13) /* 32 bit offset to GOT. */
+ RELOC_NUMBER (R_390_GOTPC, 14) /* 32 bit PC relative offset to GOT. */
+ RELOC_NUMBER (R_390_GOT16, 15) /* 16 bit GOT offset. */
+ RELOC_NUMBER (R_390_PC16, 16) /* PC relative 16 bit. */
+ RELOC_NUMBER (R_390_PC16DBL, 17) /* PC relative 16 bit shifted by 1. */
+ RELOC_NUMBER (R_390_PLT16DBL, 18) /* 16 bit PC rel. PLT shifted by 1. */
+ RELOC_NUMBER (R_390_PC32DBL, 19) /* PC relative 32 bit shifted by 1. */
+ RELOC_NUMBER (R_390_PLT32DBL, 20) /* 32 bit PC rel. PLT shifted by 1. */
+ RELOC_NUMBER (R_390_GOTPCDBL, 21) /* 32 bit PC rel. GOT shifted by 1. */
+ RELOC_NUMBER (R_390_64, 22) /* Direct 64 bit. */
+ RELOC_NUMBER (R_390_PC64, 23) /* PC relative 64 bit. */
+ RELOC_NUMBER (R_390_GOT64, 24) /* 64 bit GOT offset. */
+ RELOC_NUMBER (R_390_PLT64, 25) /* 64 bit PC relative PLT address. */
+ RELOC_NUMBER (R_390_GOTENT, 26) /* 32 bit PC rel. to GOT entry >> 1. */
+ /* These are GNU extensions to enable C++ vtable garbage collection. */
+ RELOC_NUMBER (R_390_GNU_VTINHERIT, 250)
+ RELOC_NUMBER (R_390_GNU_VTENTRY, 251)
+END_RELOC_NUMBERS (R_390_max)
+
+#endif /* _ELF_390_H */
+
+
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 9dfdcd3..6e3d09f 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,7 @@
+2001-02-09 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * s390.h: New file.
+
2001-02-02 Patrick Macdonald <patrickm@redhat.com>
* cgen.h (CGEN_SYNTAX_CHAR_TYPE): Typedef as unsigned short.
diff --git a/include/opcode/s390.h b/include/opcode/s390.h
new file mode 100644
index 0000000..8a7c00e
--- /dev/null
+++ b/include/opcode/s390.h
@@ -0,0 +1,130 @@
+/* s390.h -- Header file for S390 opcode table
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.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 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#ifndef S390_H
+#define S390_H
+
+/* List of instruction sets variations. */
+
+enum s390_opcode_arch_val
+ {
+ S390_OPCODE_ESA = 0,
+ S390_OPCODE_ESAME
+ };
+
+/* The opcode table is an array of struct s390_opcode. */
+
+struct s390_opcode
+ {
+ /* The opcode name. */
+ const char * name;
+
+ /* The opcode itself. Those bits which will be filled in with
+ operands are zeroes. */
+ unsigned char opcode[6];
+
+ /* The opcode mask. This is used by the disassembler. This is a
+ mask containing ones indicating those bits which must match the
+ opcode field, and zeroes indicating those bits which need not
+ match (and are presumably filled in by operands). */
+ unsigned char mask[6];
+
+ /* The opcode length in bytes. */
+ int oplen;
+
+ /* An array of operand codes. Each code is an index into the
+ operand table. They appear in the order which the operands must
+ appear in assembly code, and are terminated by a zero. */
+ unsigned char operands[6];
+
+ /* Bitmask of architectures this opcode is available for. */
+ unsigned int architecture;
+ };
+
+/* The table itself is sorted by major opcode number, and is otherwise
+ in the order in which the disassembler should consider
+ instructions. */
+extern const struct s390_opcode s390_opcodes[];
+extern const int s390_num_opcodes;
+
+/* A opcode format table for the .insn pseudo mnemonic. */
+extern const struct s390_opcode s390_opformats[];
+extern const int s390_num_opformats;
+
+/* Values defined for the flags field of a struct powerpc_opcode. */
+
+/* The operands table is an array of struct s390_operand. */
+
+struct s390_operand
+ {
+ /* The number of bits in the operand. */
+ int bits;
+
+ /* How far the operand is left shifted in the instruction. */
+ int shift;
+
+ /* One bit syntax flags. */
+ unsigned long flags;
+ };
+
+/* Elements in the table are retrieved by indexing with values from
+ the operands field of the powerpc_opcodes table. */
+
+extern const struct s390_operand s390_operands[];
+
+/* Values defined for the flags field of a struct s390_operand. */
+
+/* This operand names a register. The disassembler uses this to print
+ register names with a leading 'r'. */
+#define S390_OPERAND_GPR 0x1
+
+/* This operand names a floating point register. The disassembler
+ prints these with a leading 'f'. */
+#define S390_OPERAND_FPR 0x2
+
+/* This operand names an access register. The disassembler
+ prints these with a leading 'a'. */
+#define S390_OPERAND_AR 0x4
+
+/* This operand names a control register. The disassembler
+ prints these with a leading 'c'. */
+#define S390_OPERAND_CR 0x8
+
+/* This operand is a displacement. */
+#define S390_OPERAND_DISP 0x10
+
+/* This operand names a base register. */
+#define S390_OPERAND_BASE 0x20
+
+/* This operand names an index register, it can be skipped. */
+#define S390_OPERAND_INDEX 0x40
+
+/* This operand is a relative branch displacement. The disassembler
+ prints these symbolically if possible. */
+#define S390_OPERAND_PCREL 0x80
+
+/* This operand takes signed values. */
+#define S390_OPERAND_SIGNED 0x100
+
+/* This operand is a length. */
+#define S390_OPERAND_LENGTH 0x200
+
+#endif /* S390_H */