2006-10-29 Randolph Chung <tausq@debian.org>
authorRandolph Chung <tausq@debian.org>
Mon, 30 Oct 2006 01:09:18 +0000 (01:09 +0000)
committerRandolph Chung <tausq@debian.org>
Mon, 30 Oct 2006 01:09:18 +0000 (01:09 +0000)
* config/tc-hppa.c (hppa_cfi_frame_initial_instructions)
(hppa_regname_to_dw2regnum): New funcions.
* config/tc-hppa.h [OBJ_ELF] (TARGET_USE_CFIPOP): Define.
(tc_cfi_frame_initial_instructions)
(tc_regname_to_dw2regnum): Define.
(hppa_cfi_frame_initial_instructions)
(hppa_regname_to_dw2regnum): Declare.
(DWARF2_LINE_MIN_INSN_LENGTH, DWARF2_DEFAULT_RETURN_COLUMN)
(DWARF2_CIE_DATA_ALIGNMENT): Define.

gas/ChangeLog
gas/config/tc-hppa.c
gas/config/tc-hppa.h

index 9172b7fa6c6d01c4927cfdf292f02db12215b391..90ea6cd4fb1b0a84f59ec3fe844e542f37569e99 100644 (file)
@@ -1,3 +1,15 @@
+2006-10-29  Randolph Chung  <tausq@debian.org>
+
+       * config/tc-hppa.c (hppa_cfi_frame_initial_instructions)
+       (hppa_regname_to_dw2regnum): New funcions.
+       * config/tc-hppa.h [OBJ_ELF] (TARGET_USE_CFIPOP): Define.
+       (tc_cfi_frame_initial_instructions)
+       (tc_regname_to_dw2regnum): Define.
+       (hppa_cfi_frame_initial_instructions)
+       (hppa_regname_to_dw2regnum): Declare.
+       (DWARF2_LINE_MIN_INSN_LENGTH, DWARF2_DEFAULT_RETURN_COLUMN)
+       (DWARF2_CIE_DATA_ALIGNMENT): Define.
+
 2006-10-29  Nick Clifton  <nickc@redhat.com>
 
        * config/tc-spu.c (md_assemble): Cast printf string size parameter
index e54ba8ed85248add305a21bcca628a103d1ef9a1..71968c0383d5f25ce27181fc0dbd25f9a6e19385 100644 (file)
@@ -25,6 +25,7 @@
 #include "as.h"
 #include "safe-ctype.h"
 #include "subsegs.h"
+#include "dw2gencfi.h"
 
 #include "bfd/libhppa.h"
 
@@ -8690,3 +8691,45 @@ const pseudo_typeS md_pseudo_table[] =
   {"word", pa_cons, 4},
   {NULL, 0, 0}
 };
+
+#ifdef OBJ_ELF
+void
+hppa_cfi_frame_initial_instructions (void)
+{
+  cfi_add_CFA_def_cfa (30, 0);
+}
+
+int
+hppa_regname_to_dw2regnum (char *regname)
+{
+  unsigned int regnum = -1;
+  unsigned int i;
+  const char *p;
+  char *q;
+  static struct { char *name; int dw2regnum; } regnames[] =
+    {
+      { "sp", 30 }, { "rp", 2 },
+    };
+
+  for (i = 0; i < ARRAY_SIZE (regnames); ++i)
+    if (strcmp (regnames[i].name, regname) == 0)
+      return regnames[i].dw2regnum;
+
+  if (regname[0] == 'r')
+    {
+      p = regname + 1;
+      regnum = strtoul (p, &q, 10);
+      if (p == q || *q || regnum >= 32)
+       return -1;
+    }
+  else if (regname[0] == 'f' && regname[1] == 'r')
+    {
+      p = regname + 2;
+      regnum = strtoul (p, &q, 10);
+      if (p == q || *q || regnum <= 4 || regnum >= 32)
+       return -1;
+      regnum += 32 - 4;
+    }
+  return regnum;
+}
+#endif
index 25e74f091527ef35e019b0b79bce28dce6817f08..f7bc8f8d97ab1eb5ba012e42dae9353bd49833a3 100644 (file)
@@ -201,4 +201,22 @@ int hppa_force_reg_syms_absolute (expressionS *, operatorT, expressionS *);
 #define TC_FIX_TYPE PTR
 #define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = NULL)
 
+#ifdef OBJ_ELF
+#define TARGET_USE_CFIPOP 1
+
+#define tc_cfi_frame_initial_instructions hppa_cfi_frame_initial_instructions
+extern void hppa_cfi_frame_initial_instructions (void);
+
+#define tc_regname_to_dw2regnum hppa_regname_to_dw2regnum
+extern int hppa_regname_to_dw2regnum (char *regname);
+
+#define DWARF2_LINE_MIN_INSN_LENGTH 4
+#define DWARF2_DEFAULT_RETURN_COLUMN 2
+#if TARGET_ARCH_SIZE == 64
+#define DWARF2_CIE_DATA_ALIGNMENT -8
+#else
+#define DWARF2_CIE_DATA_ALIGNMENT -4
+#endif
+#endif
+
 #endif /* _TC_HPPA_H */