aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-alpha.c5
-rw-r--r--gas/config/tc-mips.c20
-rw-r--r--gas/config/tc-mips.h13
3 files changed, 35 insertions, 3 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 30f180f..2a7466a 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -3691,6 +3691,8 @@ static struct alpha_elf_frame_data *all_frame_data;
static struct alpha_elf_frame_data **plast_frame_data = &all_frame_data;
static struct alpha_elf_frame_data *cur_frame_data;
+extern int all_cfi_sections;
+
/* Handle the .section pseudo-op. This is like the usual one, but it
clears alpha_insn_label and restores auto alignment. */
@@ -3714,6 +3716,8 @@ s_alpha_ent (int dummy ATTRIBUTE_UNUSED)
char *name, name_end;
name = input_line_pointer;
name_end = get_symbol_end ();
+ /* CFI_EMIT_eh_frame is the default. */
+ all_cfi_sections = CFI_EMIT_eh_frame;
if (! is_name_beginner (*name))
{
@@ -4061,6 +4065,7 @@ alpha_elf_md_end (void)
S_GET_VALUE (p->func_sym),
symbol_get_frag (p->func_sym)));
+ cfi_set_sections ();
cfi_set_return_column (p->ra_regno);
cfi_add_CFA_def_cfa_register (30);
if (p->fp_regno != 30 || p->mask || p->fmask || p->frame_size)
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 40e38f8..8f2ec65 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -14840,7 +14840,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
|| fixP->fx_r_type == BFD_RELOC_MICROMIPS_SUB
|| fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fixP->fx_r_type == BFD_RELOC_MIPS_TLS_DTPREL64);
+ || fixP->fx_r_type == BFD_RELOC_MIPS_TLS_DTPREL64
+ || fixP->fx_r_type == BFD_RELOC_NONE);
buf = fixP->fx_frag->fr_literal + fixP->fx_where;
@@ -15110,6 +15111,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
S_SET_WEAK (fixP->fx_addsy);
break;
+ case BFD_RELOC_NONE:
case BFD_RELOC_VTABLE_ENTRY:
fixP->fx_done = 0;
break;
@@ -16304,7 +16306,7 @@ s_ehword (int ignore ATTRIBUTE_UNUSED)
p = frag_more (4);
md_number_to_chars (p, 0, 4);
fix_new_exp (frag_now, p - frag_now->fr_literal, 4, &ex, FALSE,
- BFD_RELOC_MIPS_EH);
+ BFD_RELOC_32_PCREL);
demand_empty_rest_of_line ();
}
@@ -17056,6 +17058,10 @@ mips_fix_adjustable (fixS *fixp)
if (fixp->fx_addsy == NULL)
return 1;
+ /* Allow relocs used for EH tables. */
+ if (fixp->fx_r_type == BFD_RELOC_32_PCREL)
+ return 1;
+
/* If symbol SYM is in a mergeable section, relocations of the form
SYM + 0 can usually be made section-relative. The mergeable data
is then identified by the section offset rather than by the symbol.
@@ -19117,3 +19123,13 @@ md_mips_end (void)
Tag_GNU_MIPS_ABI_FP, fpabi);
}
}
+
+/* Returns the relocation type required for a particular CFI encoding. */
+
+bfd_reloc_code_real_type
+mips_cfi_reloc_for_encoding (int encoding)
+{
+ if (encoding == (DW_EH_PE_sdata4 | DW_EH_PE_pcrel))
+ return BFD_RELOC_32_PCREL;
+ else return BFD_RELOC_NONE;
+}
diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h
index dd8350c..6cb3868 100644
--- a/gas/config/tc-mips.h
+++ b/gas/config/tc-mips.h
@@ -176,7 +176,9 @@ extern enum dwarf2_format mips_dwarf2_format (asection *);
extern int mips_dwarf2_addr_size (void);
#define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size ()
-#define DWARF2_FDE_RELOC_SIZE mips_dwarf2_addr_size ()
+#define DWARF2_FDE_RELOC_SIZE (compact_eh ? 4 : mips_dwarf2_addr_size ())
+#define DWARF2_FDE_RELOC_ENCODING(enc) \
+ (enc | (compact_eh ? DW_EH_PE_pcrel : 0))
#define TARGET_USE_CFIPOP 1
@@ -189,6 +191,15 @@ extern int tc_mips_regname_to_dw2regnum (char *regname);
#define DWARF2_DEFAULT_RETURN_COLUMN 31
#define DWARF2_CIE_DATA_ALIGNMENT (-4)
+#if defined(OBJ_ELF)
+
+#define tc_cfi_reloc_for_encoding mips_cfi_reloc_for_encoding
+extern bfd_reloc_code_real_type mips_cfi_reloc_for_encoding (int encoding);
+
+#define tc_compact_eh_opcode_stop 0x5c
+#define tc_compact_eh_opcode_pad 0x5f
+
+#endif
#define DIFF_EXPR_OK
/* We define DIFF_EXPR_OK because of R_MIPS_PC32, but we have no
64-bit form for n64 CFIs. */