This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

XCOFF/PE hack removal


I'd like to apply the following so that errors reported when linking
powerpc64-elf objects discern between a function descriptor symbol
and it's associated function code symbol, which only differs by a
leading dot.  However, this will affect PE and XCOFF error messages,
so I'd like an OK from the opposition camp first.  If not OK, then
I'll do something target dependent.

ld/ChangeLog
	* ldmisc.c (demangle): Put back dots when string not demangled.
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

Index: ld/ldmisc.c
===================================================================
RCS file: /cvs/src/src/ld/ldmisc.c,v
retrieving revision 1.8
diff -u -p -r1.8 ldmisc.c
--- ldmisc.c	2001/09/26 01:55:44	1.8
+++ ldmisc.c	2002/01/22 09:08:55
@@ -69,6 +69,7 @@ demangle (string)
      const char *string;
 {
   char *res;
+  int dots = 0;
 
   if (output_bfd != NULL
       && bfd_get_symbol_leading_char (output_bfd) == string[0])
@@ -78,9 +79,13 @@ demangle (string)
      format.  Xcoff has a single '.', while the NT PE for PPC has
      '..'.  So we remove all of them.  */
   while (string[0] == '.')
-    ++string;
+    {
+      ++dots;
+      ++string;
+    }
 
   res = cplus_demangle (string, DMGL_ANSI | DMGL_PARAMS);
+  string -= dots;
   return res ? res : xstrdup (string);
 }


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