aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-hppa.c
diff options
context:
space:
mode:
authorRandolph Chung <tausq@debian.org>2006-10-30 01:09:18 +0000
committerRandolph Chung <tausq@debian.org>2006-10-30 01:09:18 +0000
commitc79b7c30b4d110404f27cca9ed19de4f0e5af14a (patch)
treec650b3fbbc0668c7a1d779f58d8ae3010bc3b614 /gas/config/tc-hppa.c
parent3091e75f27aa243a8c50c83bc93992f18d8bf9a7 (diff)
downloadgdb-c79b7c30b4d110404f27cca9ed19de4f0e5af14a.zip
gdb-c79b7c30b4d110404f27cca9ed19de4f0e5af14a.tar.gz
gdb-c79b7c30b4d110404f27cca9ed19de4f0e5af14a.tar.bz2
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.
Diffstat (limited to 'gas/config/tc-hppa.c')
-rw-r--r--gas/config/tc-hppa.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index e54ba8e..71968c0 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -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