Add support for the .cfi pseudo-ops for VAX.

This commit is contained in:
matt 2014-03-18 23:41:36 +00:00
parent 95d660c12b
commit b47c61b618
2 changed files with 49 additions and 6 deletions

View File

@ -24,6 +24,7 @@
#include "vax-inst.h"
#include "obstack.h" /* For FRAG_APPEND_1_CHAR macro in "frags.h" */
#include "dw2gencfi.h"
#include "subsegs.h"
#include "safe-ctype.h"
@ -3570,3 +3571,37 @@ md_atof (int type, char * litP, int * sizeP)
{
return vax_md_atof (type, litP, sizeP);
}
void
vax_cfi_frame_initial_instructions (void)
{
cfi_add_CFA_def_cfa (14, 0);
}
int
tc_vax_regname_to_dw2regnum (char *regname)
{
unsigned int i;
static const struct { char *name; int dw2regnum; } regnames[] =
{
{ "r0", 0 }, { "r1", 1 }, { "r2", 2 }, { "r3", 3 },
{ "r4", 4 }, { "r5", 5 }, { "r6", 6 }, { "r7", 7 },
{ "r8", 8 }, { "r9", 9 }, { "r10", 10 }, { "r11", 11 },
{ "ap", 12 }, { "fp", 13 }, { "sp", 14 }, { "pc", 15 },
{ "psw", 16 },
};
for (i = 0; i < ARRAY_SIZE (regnames); ++i)
if (strcmp (regnames[i].name, regname) == 0)
return regnames[i].dw2regnum;
return -1;
}
void
vax_cfi_emit_pcrel_expr (expressionS *exp, unsigned int nbytes)
{
vax_cons_special_reloc = "pcrel";
emit_expr (exp, nbytes);
vax_cons_special_reloc = NULL;
}

View File

@ -71,9 +71,17 @@ extern const struct relax_type md_relax_table[];
== S_GET_SEGMENT ((FIX)->fx_addsy))) \
|| S_IS_LOCAL ((FIX)->fx_addsy)))
/*
* Local Variables:
* comment-column: 0
* fill-column: 131
* End:
*/
#define TARGET_USE_CFIPOP 1
#define tc_cfi_frame_initial_instructions vax_cfi_frame_initial_instructions
extern void vax_cfi_frame_initial_instructions (void);
#define tc_regname_to_dw2regnum tc_vax_regname_to_dw2regnum
extern int tc_vax_regname_to_dw2regnum (char *);
#define tc_cfi_emit_pcrel_expr vax_cfi_emit_pcrel_expr
extern void vax_cfi_emit_pcrel_expr (expressionS *, unsigned int);
#define DWARF2_LINE_MIN_INSN_LENGTH 1
#define DWARF2_DEFAULT_RETURN_COLUMN 15
#define DWARF2_CIE_DATA_ALIGNMENT -4