re PR bootstrap/81033 (there are cases where ld64 is not able to determine correct...
authorDominique d'Humieres <dominiq@lps.ens.fr>
Mon, 3 Jul 2017 15:53:56 +0000 (17:53 +0200)
committerDominique d'Humieres <dominiq@gcc.gnu.org>
Mon, 3 Jul 2017 15:53:56 +0000 (17:53 +0200)
2017-07-03  Dominique d'Humieres  <dominiq@lps.ens.fr>

PR target/81033
* config/darwin.c (darwin_function_switched_text_sections):
Replace DECL_NAME with DECL_ASSEMBLER_NAME, split assemble_name_raw
in two pieces, and suppress the use of buf.

From-SVN: r249926

gcc/ChangeLog
gcc/config/darwin.c

index 349eb6094abb7ecf73e5eec20353b1d41046bcb2..8671c4d1b63805b2e2965edf4b188c9718348c26 100644 (file)
@@ -1,3 +1,10 @@
+2017-07-03  Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+       PR target/81033
+       * config/darwin.c (darwin_function_switched_text_sections):
+       Replace DECL_NAME with DECL_ASSEMBLER_NAME, split assemble_name_raw
+       in two pieces, and suppress the use of buf.
+
 2017-07-03  Nathan Sidwell  <nathan@acm.org>
 
        * hash-table.h (hash_table_mod1): Fix indentation.
index 8e6e25ab7f555d73d433607bf1ba67d155c76d0b..4010ed31e48174330065e5f65659d5b7c9b92ee6 100644 (file)
@@ -3683,11 +3683,9 @@ default_function_sections:
 void
 darwin_function_switched_text_sections (FILE *fp, tree decl, bool new_is_cold)
 {
-  char buf[128];
-  snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
-           IDENTIFIER_POINTER (DECL_NAME (decl)));
   /* Make sure we pick up all the relevant quotes etc.  */
-  assemble_name_raw (fp, (const char *) buf);
+  assemble_name_raw (fp, new_is_cold?"__cold_sect_of_":"__hot_sect_of_");
+  assemble_name_raw (fp, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
   fputs (":\n", fp);
 }