This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch, mips, stabs] Fix stabs failures in GCC testsuite
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Steve Ellcey " <sellcey at imgtec dot com>
- Cc: <binutils at sourceware dot org>
- Date: Thu, 02 May 2013 23:32:22 +0100
- Subject: Re: [patch, mips, stabs] Fix stabs failures in GCC testsuite
- References: <a4320a50-094e-4cd7-bb78-d7b7864d1bab at BAMAIL02 dot ba dot imgtec dot org>
"Steve Ellcey " <sellcey@imgtec.com> writes:
> Richard,
>
> A while back you sent me this MIPS assembler patch to fix some failures
> in the GCC testsuite that I was seeing. I have tested it and would like
> to see it checked in. Would you be willing to check this in and/or give
> me the OK to check it in? This question usually results in an email
> string about removing stabs support but I would like to just check this
> in so that they work for now and leave the question of removing stabs
> support for later.
Thanks for the prod. I had to go back and work out why I thought this
change was right in the first place (my excuse for putting it off so long).
Here's what I committed.
Richard
gas/
* config/tc-mips.c (mips_pseudo_table): Add stabd and stabs entries.
(s_mips_stab): Do not restrict to stabn only.
gas/testsuite/
* gas/mips/mips16-stabs.s, gas/mips/mips16-stabs.d: New test.
* gas/mips/mips.exp: Run it.
Index: gas/config/tc-mips.c
===================================================================
--- gas/config/tc-mips.c 2013-05-02 22:02:09.835632380 +0100
+++ gas/config/tc-mips.c 2013-05-02 22:20:03.806071250 +0100
@@ -1472,7 +1472,9 @@ static const pseudo_typeS mips_pseudo_ta
{"section", s_change_section, 0},
{"short", s_cons, 1},
{"single", s_float_cons, 'f'},
+ {"stabd", s_mips_stab, 'd'},
{"stabn", s_mips_stab, 'n'},
+ {"stabs", s_mips_stab, 's'},
{"text", s_change_sec, 't'},
{"word", s_cons, 2},
@@ -17088,18 +17090,24 @@ s_insn (int ignore ATTRIBUTE_UNUSED)
demand_empty_rest_of_line ();
}
-/* Handle a .stabn directive. We need these in order to mark a label
- as being a mips16 text label correctly. Sometimes the compiler
- will emit a label, followed by a .stabn, and then switch sections.
- If the label and .stabn are in mips16 mode, then the label is
- really a mips16 text label. */
+/* Handle a .stab[snd] directive. Ideally these directives would be
+ implemented in a transparent way, so that removing them would not
+ have any effect on the generated instructions. However, s_stab
+ internally changes the section, so in practice we need to decide
+ now whether the preceding label marks compressed code. We do not
+ support changing the compression mode of a label after a .stab*
+ directive, such as in:
+
+ foo:
+ .stabs ...
+ .set mips16
+
+ so the current mode wins. */
static void
s_mips_stab (int type)
{
- if (type == 'n')
- mips_mark_labels ();
-
+ mips_mark_labels ();
s_stab (type);
}
Index: gas/testsuite/gas/mips/mips16-stabs.s
===================================================================
--- /dev/null 2013-05-02 21:14:45.645252275 +0100
+++ gas/testsuite/gas/mips/mips16-stabs.s 2013-05-02 22:20:03.808071268 +0100
@@ -0,0 +1,8 @@
+ .align 2
+ .set mips16
+ .globl foo
+ .ent foo
+foo:
+ .stabs "foo:F(0,49)",36,0,0,foo
+ jr $31
+ .end foo
Index: gas/testsuite/gas/mips/mips16-stabs.d
===================================================================
--- /dev/null 2013-05-02 21:14:45.645252275 +0100
+++ gas/testsuite/gas/mips/mips16-stabs.d 2013-05-02 23:09:48.010877005 +0100
@@ -0,0 +1,6 @@
+#as: -mips3 -EB
+#objdump: -dr
+#...
+0+ <foo>:
+ 0: e820 jr ra
+#pass
Index: gas/testsuite/gas/mips/mips.exp
===================================================================
--- gas/testsuite/gas/mips/mips.exp 2013-05-02 22:02:09.835632380 +0100
+++ gas/testsuite/gas/mips/mips.exp 2013-05-02 22:20:03.807071259 +0100
@@ -1086,6 +1086,7 @@ if { [istarget mips*-*-vxworks*] } {
if $has_newabi {
run_dump_test "mips16-dwarf2-n32"
}
+ run_dump_test "mips16-stabs"
}
if { !$no_mips16 } {
run_dump_test "mips16e-jrc"