This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Clean global object source of file function name (PR target/35485)


The original patch needed a slight tweak for type safety.

Again, nothing guarantees that a global symbol uses a characters that are
safe for a label or function on the target.  This patch cleans the
prefix produced
by the global symbol in the same way as a prefix produced by other methods.

Bootstrapped on powerpc-ibm-aix5.3.0.0

Okay for mainline?

Thanks, David


        PR target/35485
        * tree.c (get_file_function_name): Clean first_global_object_name.

Index: tree.c
===================================================================
--- tree.c      (revision 141170)
+++ tree.c      (working copy)
@@ -6923,7 +6923,10 @@

   /* If we already have a name we know to be unique, just use that.  */
   if (first_global_object_name)
-    p = first_global_object_name;
+    {
+      p = q = ASTRDUP (first_global_object_name);
+      clean_symbol_name (q);
+    }
   /* If the target is handling the constructors/destructors, they
      will be local to this file and the name is only necessary for
      debugging purposes.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]