This is the mail archive of the gcc-bugs@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]

[Bug other/16394] collect2 doesn't work well with gnu linker


------- Additional Comments From hjl at lucon dot org  2004-07-06 21:37 -------
The GNU linker supports --demangle. I think we should do something like

--- collect2.c.demangle 2004-03-09 08:08:49.000000000 -0800
+++ collect2.c  2004-07-06 14:19:47.053288777 -0700
@@ -492,10 +493,14 @@ dump_file (const char *name)
          if (!strncmp (p, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX)))
            p += strlen (USER_LABEL_PREFIX);
  
+#ifdef COLLECT_GNU_LINKER
+         result = 0;
+#else
          if (no_demangle)
            result = 0;
          else
            result = cplus_demangle (p, DMGL_PARAMS | DMGL_ANSI |
DMGL_VERBOSE);+#endif
  
          if (result)
            {
@@ -842,8 +847,8 @@ main (int argc, char **argv)
   /* Do not invoke xcalloc before this point, since locale needs to be
      set first, in case a diagnostic is issued.  */
  
-  ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3));
-  ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10));
+  ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+4));
+  ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+11));
   object = (const char **)(object_lst = xcalloc(sizeof (char *), argc));
  
 #ifdef DEBUG
@@ -1064,6 +1069,10 @@ main (int argc, char **argv)
   /* After the first file, put in the c++ rt0.  */
  
   first_file = 1;
+#ifdef COLLECT_GNU_LINKER
+  if (!no_demangle)
+    *ld1++ = *ld2++ = "--demangle";
+#endif
   while ((arg = *++argv) != (char *) 0)
     {
       *ld1++ = *ld2++ = arg;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16394


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