darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore.
authorMike Stump <mrs@apple.com>
Thu, 8 Jul 2004 00:12:27 +0000 (00:12 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Thu, 8 Jul 2004 00:12:27 +0000 (00:12 +0000)
* darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore.
* darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name)
(machopic_finish): Likewise.

From-SVN: r84245

gcc/ChangeLog
gcc/config/darwin.c
gcc/config/darwin.h

index 11e1eb01bf18450529e95c2d8bcb93f9fabab28e..224e26a27c4986b252f0e737563bd3239a748397 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-07  Mike Stump  <mrs@apple.com>
+
+       * darwin.h (ASM_OUTPUT_LABELREF): Fix -fno-leading-underscore.
+       * darwin.c (machopic_non_lazy_ptr_name, machopic_stub_name) 
+       (machopic_finish): Likewise.
+
 2004-07-07  Richard Henderson  <rth@redhat.com>
 
        * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): Look
index 63c75df7c8e3af8c4a9f260d62940a1a97126133..17d7fb77f030b839949eeea217c122b29d4c6603 100644 (file)
@@ -308,9 +308,10 @@ machopic_non_lazy_ptr_name (const char *name)
       }
     else
       {
-       buffer[bufferlen] = '_';
-       memcpy (buffer + bufferlen +1, name, namelen+1);
-        bufferlen += namelen +1;
+       strcpy (buffer + bufferlen, user_label_prefix);
+       bufferlen += strlen (user_label_prefix);
+       memcpy (buffer + bufferlen, name, namelen+1);
+        bufferlen += namelen;
       }
 
     memcpy (buffer + bufferlen, "$non_lazy_ptr", strlen("$non_lazy_ptr")+1);
@@ -383,9 +384,10 @@ machopic_stub_name (const char *name)
       }
     else
       {
-       buffer[bufferlen] = '_';
-       memcpy (buffer + bufferlen +1, name, namelen+1);
-        bufferlen += namelen +1;
+       strcpy (buffer + bufferlen, user_label_prefix);
+       bufferlen += strlen (user_label_prefix);
+       memcpy (buffer + bufferlen, name, namelen+1);
+        bufferlen += namelen;
       }
 
     if (needs_quotes)
@@ -909,13 +911,13 @@ machopic_finish (FILE *asm_out_file)
       else if (sym_name[0] == '-' || sym_name[0] == '+')
        strcpy (sym, sym_name);
       else
-       sym[0] = '_', strcpy (sym + 1, sym_name);
+       sprintf (sym, "%s%s", user_label_prefix, sym_name);
 
       stub = alloca (strlen (stub_name) + 2);
       if (stub_name[0] == '*' || stub_name[0] == '&')
        strcpy (stub, stub_name + 1);
       else
-       stub[0] = '_', strcpy (stub + 1, stub_name);
+       sprintf (stub, "%s%s", user_label_prefix, stub_name);
 
       machopic_output_stub (asm_out_file, sym, stub);
     }
index 582e707aae920120947533fc0f69b47484166cba..7f6e8dcf8b887416260e40ff64b5e5a63dc6ea44 100644 (file)
@@ -493,7 +493,7 @@ do { text_section ();                                                       \
        else if (!strncmp (xname, ".objc_class_name_", 17))                  \
         fprintf (FILE, "%s", xname);                                        \
        else                                                                 \
-         fprintf (FILE, "_%s", xname);                                      \
+         asm_fprintf (FILE, "%U%s", xname);                                 \
   } while (0)
 
 /* Output before executable code.  */