diff options
author | Randolph Chung <tausq@debian.org> | 2006-10-30 01:09:18 +0000 |
---|---|---|
committer | Randolph Chung <tausq@debian.org> | 2006-10-30 01:09:18 +0000 |
commit | c79b7c30b4d110404f27cca9ed19de4f0e5af14a (patch) | |
tree | c650b3fbbc0668c7a1d779f58d8ae3010bc3b614 /gas | |
parent | 3091e75f27aa243a8c50c83bc93992f18d8bf9a7 (diff) | |
download | gdb-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')
-rw-r--r-- | gas/ChangeLog | 12 | ||||
-rw-r--r-- | gas/config/tc-hppa.c | 43 | ||||
-rw-r--r-- | gas/config/tc-hppa.h | 18 |
3 files changed, 73 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 9172b7f..90ea6cd 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -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 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 diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h index 25e74f0..f7bc8f8 100644 --- a/gas/config/tc-hppa.h +++ b/gas/config/tc-hppa.h @@ -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 */ |