aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Anglin <dave.anglin@nrc.ca>2008-09-07 22:54:54 +0000
committerDave Anglin <dave.anglin@nrc.ca>2008-09-07 22:54:54 +0000
commit3dd243066bca0093af6a653cc25507596d5ea0b4 (patch)
tree314d88a024c5f1ae9ee221ebb46a742418d7357d
parent66c103b772fdbc413d4727efa329babcab6617c5 (diff)
downloadgdb-3dd243066bca0093af6a653cc25507596d5ea0b4.zip
gdb-3dd243066bca0093af6a653cc25507596d5ea0b4.tar.gz
gdb-3dd243066bca0093af6a653cc25507596d5ea0b4.tar.bz2
* dw2gencfi.c (CFI_DIFF_EXPR_OK): Define if not defined.
(dot_cfi_personality): Use CFI_DIFF_EXPR_OK instead of DIFF_EXPR_OK. (dot_cfi_lsda, output_cie, output_fde): Likewise. * config/tc-hppa.h (CFI_DIFF_EXPR_OK): Define.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-hppa.h4
-rw-r--r--gas/dw2gencfi.c21
3 files changed, 26 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0d55727..9237bed 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * dw2gencfi.c (CFI_DIFF_EXPR_OK): Define if not defined.
+ (dot_cfi_personality): Use CFI_DIFF_EXPR_OK instead of DIFF_EXPR_OK.
+ (dot_cfi_lsda, output_cie, output_fde): Likewise.
+ * config/tc-hppa.h (CFI_DIFF_EXPR_OK): Define.
+
2008-09-06 Richard Sandiford <rdsandiford@googlemail.com>
* config/tc-mips.h (DWARF2_FDE_RELOC_SIZE): Define.
diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h
index c3082a2..3a45e08 100644
--- a/gas/config/tc-hppa.h
+++ b/gas/config/tc-hppa.h
@@ -222,6 +222,10 @@ extern int hppa_regname_to_dw2regnum (char *regname);
/* Due to the way dynamic linking to personality functions is handled
on HP-UX, we need to have a read-write .eh_frame section. */
#define DWARF2_EH_FRAME_READ_ONLY 0
+
+/* Because differences between text and data symbols don't work, we
+ can't use difference expressions during CFI generation. */
+#define CFI_DIFF_EXPR_OK 0
#endif
#endif /* OBJ_ELF */
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index 520d1e1..49a23ad 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -25,6 +25,15 @@
#ifdef TARGET_USE_CFIPOP
+/* By default, use difference expressions if DIFF_EXPR_OK is defined. */
+#ifndef CFI_DIFF_EXPR_OK
+# ifdef DIFF_EXPR_OK
+# define CFI_DIFF_EXPR_OK 1
+# else
+# define CFI_DIFF_EXPR_OK 0
+# endif
+#endif
+
/* We re-use DWARF2_LINE_MIN_INSN_LENGTH for the code alignment field
of the CIE. Default to 1 if not otherwise specified. */
#ifndef DWARF2_LINE_MIN_INSN_LENGTH
@@ -655,7 +664,7 @@ dot_cfi_personality (int ignored ATTRIBUTE_UNUSED)
if ((encoding & 0xff) != encoding
|| ((encoding & 0x70) != 0
-#if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr
+#if CFI_DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr
&& (encoding & 0x70) != DW_EH_PE_pcrel
#endif
)
@@ -725,7 +734,7 @@ dot_cfi_lsda (int ignored ATTRIBUTE_UNUSED)
if ((encoding & 0xff) != encoding
|| ((encoding & 0x70) != 0
-#if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr
+#if CFI_DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr
&& (encoding & 0x70) != DW_EH_PE_pcrel
#endif
)
@@ -1092,7 +1101,7 @@ output_cie (struct cie_entry *cie)
exp = cie->personality;
if ((cie->per_encoding & 0x70) == DW_EH_PE_pcrel)
{
-#ifdef DIFF_EXPR_OK
+#if CFI_DIFF_EXPR_OK
exp.X_op = O_subtract;
exp.X_op_symbol = symbol_temp_new_now ();
emit_expr (&exp, size);
@@ -1122,7 +1131,7 @@ output_cie (struct cie_entry *cie)
default:
abort ();
}
-#if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr
+#if CFI_DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr
enc |= DW_EH_PE_pcrel;
#endif
out_one (enc);
@@ -1157,7 +1166,7 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie,
exp.X_op_symbol = cie->start_address;
emit_expr (&exp, 4); /* CIE offset. */
-#ifdef DIFF_EXPR_OK
+#if CFI_DIFF_EXPR_OK
exp.X_add_symbol = fde->start_address;
exp.X_op_symbol = symbol_temp_new_now ();
emit_expr (&exp, DWARF2_FDE_RELOC_SIZE); /* Code offset. */
@@ -1185,7 +1194,7 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie,
exp = fde->lsda;
if ((fde->lsda_encoding & 0x70) == DW_EH_PE_pcrel)
{
-#ifdef DIFF_EXPR_OK
+#if CFI_DIFF_EXPR_OK
exp.X_op = O_subtract;
exp.X_op_symbol = symbol_temp_new_now ();
emit_expr (&exp, augmentation_size);