aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-s390.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-07-10 16:46:38 +0000
committerJakub Jelinek <jakub@redhat.com>2003-07-10 16:46:38 +0000
commit75e21f08dc057f373ed4b9c76ddc54b2e3a0ee9d (patch)
treecf79f4f416894f9a845e34c59453f1e463fba3ed /gas/config/tc-s390.c
parenteff26f7814f8020f59ea8819f2cb836c4dba2f84 (diff)
downloadgdb-75e21f08dc057f373ed4b9c76ddc54b2e3a0ee9d.zip
gdb-75e21f08dc057f373ed4b9c76ddc54b2e3a0ee9d.tar.gz
gdb-75e21f08dc057f373ed4b9c76ddc54b2e3a0ee9d.tar.bz2
* config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): Define always.
(TARGET_USE_CFIPOP, tc_cfi_frame_initial_instructions, tc_regname_to_dw2regnum, DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Define. (ppc_cfi_frame_initial_instructions, tc_ppc_regname_to_dw2regnum): New prototypes. (ppc_cie_data_alignment): Declare. * config/tc-ppc.c: Include dw2gencfi.h. (ppc_cie_data_alignment): Define. (md_begin): Initialize ppc_cie_data_alignment. (ppc_cfi_frame_initial_instructions, tc_ppc_regname_to_dw2regnum): New functions. * config/tc-s390.h (DWARF2_LINE_MIN_INSN_LENGTH): Define always. (TARGET_USE_CFIPOP, tc_cfi_frame_initial_instructions, tc_regname_to_dw2regnum, DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Define. (s390_cfi_frame_initial_instructions, tc_s390_regname_to_dw2regnum): New prototypes. (s390_cie_data_alignment): Declare. * config/tc-s390.c: Include dw2gencfi.h. (s390_cie_data_alignment): Define. (md_begin): Initialize s390_cie_data_alignment. (s390_cfi_frame_initial_instructions, tc_s390_regname_to_dw2regnum): New functions. * gas/cfi/cfi-ppc-1.s: New test. * gas/cfi/cfi-ppc-1.d: New test. * gas/cfi/cfi-s390-1.s: New test. * gas/cfi/cfi-s390-1.s: New test. * gas/cfi/cfi-s390x-1.s: New test. * gas/cfi/cfi-s390x-1.s: New test. * gas/cfi/cfi.exp: Run them.
Diffstat (limited to 'gas/config/tc-s390.c')
-rw-r--r--gas/config/tc-s390.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 9957019..61764ef 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -25,6 +25,7 @@
#include "subsegs.h"
#include "struc-symbol.h"
#include "dwarf2dbg.h"
+#include "dw2gencfi.h"
#include "opcode/s390.h"
#include "elf/s390.h"
@@ -70,6 +71,9 @@ const char EXP_CHARS[] = "eE";
as in 0d1.0. */
const char FLT_CHARS[] = "dD";
+/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */
+int s390_cie_data_alignment;
+
/* The target specific pseudo-ops which we support. */
/* Define the prototypes for the pseudo-ops */
@@ -478,6 +482,8 @@ md_begin ()
if (s390_arch_size == 64 && current_cpu < S390_OPCODE_Z900)
as_warn ("The 64 bit file format is used without esame instructions.");
+ s390_cie_data_alignment = -s390_arch_size / 8;
+
/* Set the ELF flags if desired. */
if (s390_flags)
bfd_set_private_flags (stdoutput, s390_flags);
@@ -2286,3 +2292,27 @@ tc_gen_reloc (seg, fixp)
return reloc;
}
+
+void
+s390_cfi_frame_initial_instructions ()
+{
+ cfi_add_CFA_def_cfa (15, s390_arch_size == 64 ? 160 : 96);
+}
+
+int
+tc_s390_regname_to_dw2regnum (const char *regname)
+{
+ int regnum = -1;
+
+ if (regname[0] != 'c' && regname[0] != 'a')
+ {
+ regnum = reg_name_search (pre_defined_registers, REG_NAME_CNT, regname);
+ if (regname[0] == 'f' && regnum != -1)
+ regnum += 16;
+ }
+ else if (strcmp (regname, "ap") == 0)
+ regnum = 32;
+ else if (strcmp (regname, "cc") == 0)
+ regnum = 33;
+ return regnum;
+}