From a3f278e22a8dcc933aae2d3e705c06615887a36d Mon Sep 17 00:00:00 2001 From: Catherine Moore Date: Fri, 31 May 2013 17:04:53 +0000 Subject: [PATCH] 2013-05-31 Paul Brook gas/ * config/tc-mips.c (s_ehword): New. 2013-05-31 Catherine Moore gas/testsuite/ * gas/mips/ehword.d: New. * gas/mips/ehword.s: New. * gas/mips/mips.exp: Run ehword test. --- gas/ChangeLog | 5 +++++ gas/config/tc-mips.c | 30 ++++++++++++++++++++++++++++++ gas/testsuite/ChangeLog | 7 +++++++ gas/testsuite/gas/mips/ehword.d | 9 +++++++++ gas/testsuite/gas/mips/ehword.s | 1 + gas/testsuite/gas/mips/mips.exp | 1 + 6 files changed, 53 insertions(+) create mode 100644 gas/testsuite/gas/mips/ehword.d create mode 100644 gas/testsuite/gas/mips/ehword.s 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 + + gas/ + * config/tc-mips.c (s_ehword): New. + 2013-05-30 Paul Brook * 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 + + 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 * 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] -- 2.7.4