aboutsummaryrefslogtreecommitdiff
path: root/gas/dw2gencfi.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-05-31 19:36:45 +0000
committerRichard Henderson <rth@redhat.com>2003-05-31 19:36:45 +0000
commiteafbc43f939a26cb4230d3d55ec637f441e3afe6 (patch)
tree8576168b3f31bd968853148dc33f86590d6449b0 /gas/dw2gencfi.c
parent38fafa6d088439f82e140d2f60f76fa0d15def57 (diff)
downloadgdb-eafbc43f939a26cb4230d3d55ec637f441e3afe6.zip
gdb-eafbc43f939a26cb4230d3d55ec637f441e3afe6.tar.gz
gdb-eafbc43f939a26cb4230d3d55ec637f441e3afe6.tar.bz2
* dw2gencfi.c (output_fde): Use fix_new to emit pc-relative reloc.
(cfi_finish): Set flag_traditional_format around .eh_frame data. * gas/alpha/elf-reloc-8.d: Correct .eh_frame relocs. * gas/cfi/cfi-alpha-2.d: New. * gas/cfi/cfi-alpha-2.s: New. * gas/cfi/cfi.exp: Run it.
Diffstat (limited to 'gas/dw2gencfi.c')
-rw-r--r--gas/dw2gencfi.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index 2239578..ee67027 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -666,9 +666,17 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie,
exp.X_op_symbol = cie->start_address;
emit_expr (&exp, 4); /* CIE offset */
+ /* ??? Unsure why this works and the following doesn't.
+ Symptom was incorrect addends to the relocation. */
+#if 1
+ memset (frag_more (4), 0, 4); /* Code offset */
+ fix_new (frag_now, frag_now_fix () - 4, 4,
+ fde->start_address, 0, 1, BFD_RELOC_32);
+#else
exp.X_add_symbol = fde->start_address;
exp.X_op_symbol = symbol_temp_new_now ();
- emit_expr (&exp, 4); /* Code offset */
+ emit_expr (&exp, 4);
+#endif
exp.X_add_symbol = fde->end_address;
exp.X_op_symbol = fde->start_address; /* Code length */
@@ -770,6 +778,7 @@ cfi_finish (void)
{
segT cfi_seg;
struct fde_entry *fde;
+ int save_flag_traditional_format;
if (cur_fde_data)
{
@@ -789,6 +798,10 @@ cfi_finish (void)
subseg_set (cfi_seg, 0);
record_alignment (cfi_seg, 2);
+ /* Make sure check_eh_frame doesn't do anything with our output. */
+ save_flag_traditional_format = flag_traditional_format;
+ flag_traditional_format = 1;
+
for (fde = all_fde_data; fde ; fde = fde->next)
{
struct cfi_insn_data *first;
@@ -797,4 +810,6 @@ cfi_finish (void)
cie = select_cie_for_fde (fde, &first);
output_fde (fde, cie, first);
}
+
+ flag_traditional_format = save_flag_traditional_format;
}