This is the mail archive of the
mailing list for the binutils project.
Re: [patch, mips, stabs] Fix stabs failures in GCC testsuite
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: Steve Ellcey <sellcey at imgtec dot com>, <binutils at sourceware dot org>
- Date: Fri, 3 May 2013 00:03:23 +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> <87wqrh3te1 dot fsf at talisman dot default>
On Thu, 2 May 2013, Richard Sandiford wrote:
> 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.
Thanks to you both for working on this -- I've noticed the problem
recently too and had a similar proposal pending. FWIW here's the comment
I prepared for that change:
/* Handle .stab directives. We need this in order to mark a label
as being a MIPS16 or microMIPS text label correctly. In the STABS
debugging mode at the beginning of a function the compiler will emit
a label, followed by a .stab directive, and only then actual code.
The .stab directive however temporarily switches sections and before
that calls md_flush_pending_output losing compressed allocation from
the label. As a result the function is called in the wrong execution
mode and does not work.
FIXME: Ideally we should be able to preserve the pending label state
across section switches and either commit label marking when a
section and its held state is discarded from the section stack with
the second section switch or restore it along its section with
.previous or .popsection. That would require a serious
infrastructure redesign, starting with a replacement of the
md_flush_pending_output hook with a more complex arrangement. */
because I think all this is really papering over the problem of forgetting
the label state across a section switch. This happens implicitly for
these .stab directives (that are also seldom used these days), but I
reckon I saw a case where it mattered for explicit section switches and
had to be worked around somehow. It would be good to have some thought as
to how to do this properly some day.