[PATCH/RFC] Mark __asm__ identifiers as referenced in varasm.c

Jeffrey Law law@redhat.com
Thu Jul 6 19:02:00 GMT 2006


On Thu, 2006-07-06 at 11:45 -0600, Roger Sayle wrote:
> Hi Steve,
> 
> On Thu, 6 Jul 2006, Steve Ellcey wrote:
> > I saw this problem too and submitted a different patch.  I got no comments
> > on it.
> >
> > http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01655.html
> >
> > I pinged again in February but still got no reponse.
> > http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00721.html
> 
> I'm sorry, I suspect I left this for someone else to respond to.
> This varasm identifier stuff isn't my usual area of expertise.
> 
> I'll admit that I appreciate the aggresive simplicity of your patch.
> 
> A little archeology reveals that the original call to the macro
> STRIP_NAME_ENCODING, which by default just stripped the asterisk
> from the start of the name, dates back to a check-in by Richard
> Kenner, subversion revision 7651, July 5th 1994.
> 
> http://gcc.gnu.org/viewcvs?view=rev&revision=7651
> 
> I'm guessing that all motivation for changes from that era have
> been lost in the mists of time.  One possible explanation might
> be that a port he was working on at the time defined its own
> implementation of STRIP_NAME_ENCODING?
The PA (and probably IA64) have their own variants of
STRIP_NAME_ENCODING (which has since been turned into a target
hook).

IIRC the purpose of the specialized encoding was to track if a
particular name refers to a function or not (necessary for correct
symbol resolution in the linker) and to record if the name
refers to an object in readonly memory (can't remember why that
was important).

To do that the PA port had two special characters in the name
encoding '*' and '@' IIRC.  Of course with the extra character
the PA port had to define its own STRIP_NAME_ENCODING.

IIRC, IA-64 inherited the need to distinguish between functions
and non-fucntions in the linker, so if the patch works on IA-64
HP-UX, then it ought to be fine for the PA as well (and probably
even fixes a bug :-)

jeff




More information about the Gcc-patches mailing list