diff mbox

AIX declare aliases

Message ID CAGWvnymtrQah=K7ucud=wbPV+ynKzBB5cTL-c=Lc5fUi6u9vrg@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Nov. 25, 2015, 12:51 p.m. UTC
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.
diff mbox

Patch

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);
    }