Index: gas/config/tc-mips.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-mips.c,v retrieving revision 1.535 diff -p -u -r1.535 tc-mips.c --- gas/config/tc-mips.c 30 May 2013 20:27:21 -0000 1.535 +++ gas/config/tc-mips.c 31 May 2013 14:30:24 -0000 @@ -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_ta {"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. */ Index: gas/testsuite/gas/mips/ehword.d =================================================================== RCS file: gas/testsuite/gas/mips/ehword.d diff -N gas/testsuite/gas/mips/ehword.d --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gas/testsuite/gas/mips/ehword.d 31 May 2013 14:30:24 -0000 @@ -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 Index: gas/testsuite/gas/mips/ehword.s =================================================================== RCS file: gas/testsuite/gas/mips/ehword.s diff -N gas/testsuite/gas/mips/ehword.s --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gas/testsuite/gas/mips/ehword.s 31 May 2013 14:30:24 -0000 @@ -0,0 +1,2 @@ + .ehword _ZTI5myExc + .section .sdata._ZTI5myExc Index: gas/testsuite/gas/mips/mips.exp =================================================================== RCS file: /cvs/src/src/gas/testsuite/gas/mips/mips.exp,v retrieving revision 1.218 diff -p -u -r1.218 mips.exp --- gas/testsuite/gas/mips/mips.exp 29 May 2013 16:22:14 -0000 1.218 +++ gas/testsuite/gas/mips/mips.exp 31 May 2013 14:30:24 -0000 @@ -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]