aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorCatherine Moore <clm@redhat.com>2013-05-31 17:04:53 +0000
committerCatherine Moore <clm@redhat.com>2013-05-31 17:04:53 +0000
commita3f278e22a8dcc933aae2d3e705c06615887a36d (patch)
tree6550165e81666c9486d58a8f482ed1f67d4aac0d /gas
parent3ca73e0c7da927485513b59c88dbc1b37502c1bd (diff)
downloadgdb-a3f278e22a8dcc933aae2d3e705c06615887a36d.zip
gdb-a3f278e22a8dcc933aae2d3e705c06615887a36d.tar.gz
gdb-a3f278e22a8dcc933aae2d3e705c06615887a36d.tar.bz2
2013-05-31 Paul Brook <paul@codesourcery.com>
gas/ * config/tc-mips.c (s_ehword): New. 2013-05-31 Catherine Moore <clm@codesourcery.com> gas/testsuite/ * gas/mips/ehword.d: New. * gas/mips/ehword.s: New. * gas/mips/mips.exp: Run ehword test.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c30
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/mips/ehword.d9
-rw-r--r--gas/testsuite/gas/mips/ehword.s1
-rw-r--r--gas/testsuite/gas/mips/mips.exp1
6 files changed, 53 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ae07be8..d80bff8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-31 Paul Brook <paul@codesourcery.com>
+
+ gas/
+ * config/tc-mips.c (s_ehword): New.
+
2013-05-30 Paul Brook <paul@codesourcery.com>
* config/tc-mips.c (md_apply_fix): Support BFD_RELOC_MIPS_EH.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 02b3cf3..0e2e5f7 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -1368,6 +1368,7 @@ static void s_tpreldword (int);
static void s_gpvalue (int);
static void s_gpword (int);
static void s_gpdword (int);
+static void s_ehword (int);
static void s_cpadd (int);
static void s_insn (int);
static void md_obj_begin (void);
@@ -1450,6 +1451,7 @@ static const pseudo_typeS mips_pseudo_table[] =
{"gpvalue", s_gpvalue, 0},
{"gpword", s_gpword, 0},
{"gpdword", s_gpdword, 0},
+ {"ehword", s_ehword, 0},
{"cpadd", s_cpadd, 0},
{"insn", s_insn, 0},
@@ -17155,6 +17157,34 @@ s_gpdword (int ignore ATTRIBUTE_UNUSED)
demand_empty_rest_of_line ();
}
+/* Handle the .ehword pseudo-op. This is used when generating unwinding
+ tables. It generates a R_MIPS_EH reloc. */
+
+static void
+s_ehword (int ignore ATTRIBUTE_UNUSED)
+{
+ expressionS ex;
+ char *p;
+
+ mips_emit_delays ();
+
+ expression (&ex);
+ mips_clear_insn_labels ();
+
+ if (ex.X_op != O_symbol || ex.X_add_number != 0)
+ {
+ as_bad (_("Unsupported use of .ehword"));
+ ignore_rest_of_line ();
+ }
+
+ 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);
+
+ demand_empty_rest_of_line ();
+}
+
/* Handle the .cpadd pseudo-op. This is used when dealing with switch
tables in SVR4 PIC code. */
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 76c9de8..f8ae2b8 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2013-05-31 Catherine Moore <clm@codesourcery.com>
+
+ gas/testsuite/
+ * gas/mips/ehword.d: New.
+ * gas/mips/ehword.s: New.
+ * gas/mips/mips.exp: Run ehword test.
+
2013-05-29 Maciej W. Rozycki <macro@codesourcery.com>
* gas/mips/jalr3.d: New test.
diff --git a/gas/testsuite/gas/mips/ehword.d b/gas/testsuite/gas/mips/ehword.d
new file mode 100644
index 0000000..4cbef12
--- /dev/null
+++ b/gas/testsuite/gas/mips/ehword.d
@@ -0,0 +1,9 @@
+#objdump: -r -j .text
+#name MIPS .ehword
+#source ehword.s
+
+.*: +file format .*mips.*
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+00000000 R_MIPS_EH _ZTI5myExc
diff --git a/gas/testsuite/gas/mips/ehword.s b/gas/testsuite/gas/mips/ehword.s
new file mode 100644
index 0000000..152ad30
--- /dev/null
+++ b/gas/testsuite/gas/mips/ehword.s
@@ -0,0 +1 @@
+ .ehword _ZTI5myExc
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index a7b85dd..95e9da7 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1124,6 +1124,7 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "align2-el"
run_dump_test "align3"
run_dump_test "odd-float"
+ run_dump_test "ehword"
run_list_test_arches "mips-macro-ill-sfp" "-32 -msingle-float" \
[mips_arch_list_matching mips2]