* collect2.c (extract_init_priority): No priority is 65535.
authorJason Merrill <jason@yorick.cygnus.com>
Mon, 12 Oct 1998 20:08:10 +0000 (20:08 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 12 Oct 1998 20:08:10 +0000 (16:08 -0400)
From-SVN: r23033

gcc/ChangeLog
gcc/collect2.c

index 6f71290a80a420abc6df869bfb1833c126728ca0..087d5dd7d601b0160d268ae5b4e2994c05e25e57 100644 (file)
@@ -1,3 +1,7 @@
+Mon Oct 12 19:57:34 1998  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * collect2.c (extract_init_priority): No priority is 65535.
+
 Mon Oct 12 12:10:37 1998  Alexandre Oliva  <oliva@dcc.unicamp.br>
        
        * Makefile.in (build_tooldir): new variable, same as old
index bfa91550874b61746491a090bbb41b240a4e29c2..cd269c408b0c40e6f710f415a12da34d3033e1a6 100644 (file)
@@ -151,6 +151,9 @@ extern char *make_temp_file PROTO ((char *));
 #define SYMBOL__MAIN __main
 #endif
 
+/* This must match tree.h.  */
+#define DEFAULT_INIT_PRIORITY 65535
+
 #if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES
 #define SCAN_LIBRARIES
 #endif
@@ -1763,14 +1766,15 @@ static int
 extract_init_priority (name)
      char *name;
 {
-  int pos = 0;
+  int pos = 0, pri;
 
   while (name[pos] == '_')
     ++pos;
   pos += 10; /* strlen ("GLOBAL__X_") */
 
   /* Extract init_p number from ctor/dtor name. */
-  return atoi (name + pos);
+  pri = atoi (name + pos);
+  return pri ? pri : DEFAULT_INIT_PRIORITY;
 }
 
 /* Insertion sort the ids from ctor/dtor list HEAD_PTR in descending order.