diff mbox series

[Darwin,PPC] Adjust formatting of picbase labels.

Message ID 270928CB-FA2C-490D-83F6-2880F032CFA7@sandoe.co.uk
State New
Headers show
Series [Darwin,PPC] Adjust formatting of picbase labels. | expand

Commit Message

Iain Sandoe May 17, 2019, 7:05 p.m. UTC
The rest of the Darwin ports now emit Lnnn$pb as the picbase
lable instead of the ancient (and hard to read) "L0000000nnn$pb".

This just updates this part of the rs6000 port, NFC intended.

tested on powerpc-darwin9 and powerpc-linux-gnu (power7)
applied to mainline.
Iain

gcc/

2019-05-17  Iain Sandoe  <iain@sandoe.co.uk>

        * config/rs6000/rs6000.c (machopic_output_stub): Adjust the
        formatting of picbase labels to match other ports.
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 155bc08..7f7b167 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -33039,7 +33039,7 @@  machopic_output_stub (FILE *file, const char *symb, const char *stub)
   unsigned int length;
   char *symbol_name, *lazy_ptr_name;
   char *local_label_0;
-  static int label = 0;
+  static unsigned label = 0;
 
   /* Lose our funky encoding stuff so it doesn't contaminate the stub.  */
   symb = (*targetm.strip_name_encoding) (symb);
@@ -33065,8 +33065,8 @@  machopic_output_stub (FILE *file, const char *symb, const char *stub)
       fprintf (file, "\t.indirect_symbol %s\n", symbol_name);
 
       label++;
-      local_label_0 = XALLOCAVEC (char, sizeof ("\"L00000000000$spb\""));
-      sprintf (local_label_0, "\"L%011d$spb\"", label);
+      local_label_0 = XALLOCAVEC (char, 16);
+      sprintf (local_label_0, "L%u$spb", label);
 
       fprintf (file, "\tmflr r0\n");
       if (TARGET_LINK_STACK)