This is the mail archive of the binutils@sourceware.org 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]

[PATCH,committed] Fix PR12166.


    Hi list,


  The attached patch fixes PR12166.  The bug is caused by the code that
derives a mangled weak external aux symbol name being overcautious about
something that can't happen (attempting to de-prefix a name after it has also
had a uniquify-ing suffix added), but the overcautious code does get falsely
tripped when there's a dot in the symbol.  The same symbol never gets frobbed
twice, so all this is unnecessary.

gas/ChangeLog:

2010-11-05  Dave Korn  <...redacted...>

	* config/obj-coff.c (weak_altname2name): Don't infer from the presence
	of a period that the symbol has been already uniquify-d.
	(weak_uniquify): Don't worry that the symbol might have been already
	uniquify-d.

  Bootstrapped and tested i686-pc-cygwin, then used for several GCC
bootstrap-and-test cycles with no anomalies.  Committed.

    cheers,
      DaveK

Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.109
diff -p -u -r1.109 obj-coff.c
--- gas/config/obj-coff.c	26 Oct 2010 03:44:39 -0000	1.109
+++ gas/config/obj-coff.c	5 Nov 2010 04:49:34 -0000
@@ -1095,15 +1095,8 @@ weak_name2altname (const char * name)
 static const char *
 weak_altname2name (const char * name)
 {
-  char * weak_name;
-  char * dot;
-
   gas_assert (weak_is_altname (name));
-
-  weak_name = xstrdup (name + 6);
-  if ((dot = strchr (weak_name, '.')))
-    *dot = 0;
-  return weak_name;
+  return xstrdup (name + 6);
 }
 
 /* Make a weak symbol name unique by
@@ -1121,9 +1114,6 @@ weak_uniquify (const char * name)
 #endif
   gas_assert (weak_is_altname (name));
 
-  if (strchr (name + sizeof (weak_altprefix), '.'))
-    return name;
-
   ret = xmalloc (strlen (name) + strlen (unique) + 2);
   strcpy (ret, name);
   strcat (ret, ".");

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