public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] AIX declare aliases
@ 2015-11-25 12:56 David Edelsohn
  0 siblings, 0 replies; only message in thread
From: David Edelsohn @ 2015-11-25 12:56 UTC (permalink / raw)
  To: GCC Patches

The initial rs6000_declare_alais support fort handle AIX function
descriptors was no complete.  For function descriptors, both the
undecorated symbols (the function descriptor) and the "dot" symbol
(the function entry point address) must be globalized and renamed.

Thanks, David

* config/rs6000/rs6000.c (rs6000_declare_alias): Rename and globalize
both the symbol and the "dot" symbol for function descriptors.  Fix
inversion for rename of symbols with dollar sign.

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 230866)
+++ rs6000.c    (working copy)
@@ -31888,13 +31888,15 @@ rs6000_declare_alias (struct symtab_node *n, void
           if (dollar_inside) {
              if (data->function_descriptor)
                 fprintf(data->file, "\t.rename .%s,\".%s\"\n", buffer, name);
-             else
-                fprintf(data->file, "\t.rename %s,\"%s\"\n", buffer, name);
+             fprintf(data->file, "\t.rename %s,\"%s\"\n", buffer, name);
            }
          if (data->function_descriptor)
-           fputs ("\t.globl .", data->file);
-         else
-           fputs ("\t.globl ", data->file);
+           {
+             fputs ("\t.globl .", data->file);
+             RS6000_OUTPUT_BASENAME (data->file, buffer);
+             putc ('\n', data->file);
+           }
+         fputs ("\t.globl ", data->file);
          RS6000_OUTPUT_BASENAME (data->file, buffer);
          putc ('\n', data->file);
        }
@@ -31908,14 +31910,16 @@ rs6000_declare_alias (struct symtab_node *n, void
       if (dollar_inside)
        {
          if (data->function_descriptor)
-            fprintf(data->file, "\t.rename %s,\"%s\"\n", buffer, name);
-         else
             fprintf(data->file, "\t.rename .%s,\".%s\"\n", buffer, name);
+         fprintf(data->file, "\t.rename %s,\"%s\"\n", buffer, name);
        }
       if (data->function_descriptor)
-       fputs ("\t.lglobl .", data->file);
-      else
-       fputs ("\t.lglobl ", data->file);
+       {
+         fputs ("\t.lglobl .", data->file);
+         RS6000_OUTPUT_BASENAME (data->file, buffer);
+         putc ('\n', data->file);
+       }
+      fputs ("\t.lglobl ", data->file);
       RS6000_OUTPUT_BASENAME (data->file, buffer);
       putc ('\n', data->file);
    }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-25 12:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-25 12:56 [PATCH] AIX declare aliases David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).