From: Randolph Chung Date: Mon, 30 Oct 2006 01:09:18 +0000 (+0000) Subject: 2006-10-29 Randolph Chung X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c79b7c30b4d110404f27cca9ed19de4f0e5af14a;p=binutils-gdb.git 2006-10-29 Randolph Chung * 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. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 9172b7fa6c6..90ea6cd4fb1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,15 @@ +2006-10-29 Randolph Chung + + * 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 * 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 e54ba8ed852..71968c0383d 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 25e74f09152..f7bc8f8d97a 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 */