This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch]: vms/alpha: avoid writing directly symbol names
- From: Tristan Gingold <gingold at adacore dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Dec 2011 16:52:46 +0100
- Subject: [Patch]: vms/alpha: avoid writing directly symbol names
Now that transparent aliases are heavily used by VMS to translate names, we shouldn't directly emit symbol name but use assemble_name.
This patch fixes some abuse.
Committed on trunk.
Tristan.
2011-12-16 Tristan Gingold <gingold@adacore.com>
* config/alpha/alpha.c (alpha_use_linkage): Follow transparent alias.
(alpha_write_one_linkage): Use assemble_name to emit linkage name.
Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c (revision 182404)
+++ config/alpha/alpha.c (working copy)
@@ -9541,10 +9541,20 @@
{
size_t buf_len;
char *linksym;
+ tree id;
if (name[0] == '*')
name++;
+ /* Follow transparent alias, as this is used for CRTL translations. */
+ id = maybe_get_identifier (name);
+ if (id)
+ {
+ while (IDENTIFIER_TRANSPARENT_ALIAS (id))
+ id = TREE_CHAIN (id);
+ name = IDENTIFIER_POINTER (id);
+ }
+
buf_len = strlen (name) + 8 + 9;
linksym = (char *) alloca (buf_len);
snprintf (linksym, buf_len, "$%d..%s..lk", cfun->funcdef_no, name);
@@ -9577,7 +9587,7 @@
if (link->rkind == KIND_CODEADDR)
{
/* External and used, request code address. */
- fprintf (stream, "\t.code_address %s\n", name);
+ fprintf (stream, "\t.code_address ");
}
else
{
@@ -9586,14 +9596,16 @@
{
/* Locally defined, build linkage pair. */
fprintf (stream, "\t.quad %s..en\n", name);
- fprintf (stream, "\t.quad %s\n", name);
+ fprintf (stream, "\t.quad ");
}
else
{
/* External, request linkage pair. */
- fprintf (stream, "\t.linkage %s\n", name);
+ fprintf (stream, "\t.linkage ");
}
}
+ assemble_name (stream, name);
+ fputs ("\n", stream);
return 0;
}