aboutsummaryrefslogtreecommitdiff
path: root/gcc/collect2.c
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-10-12 20:08:10 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-10-12 16:08:10 -0400
commit6f87c7d816816fdd66e28e4fa72c52f05bba82b9 (patch)
tree33f42f7258003e602ecb526953556338525f92f1 /gcc/collect2.c
parentc98e175c2d01b99a2b76bd6e1a815553c540a19b (diff)
downloadgcc-6f87c7d816816fdd66e28e4fa72c52f05bba82b9.zip
gcc-6f87c7d816816fdd66e28e4fa72c52f05bba82b9.tar.gz
gcc-6f87c7d816816fdd66e28e4fa72c52f05bba82b9.tar.bz2
* collect2.c (extract_init_priority): No priority is 65535.
From-SVN: r23033
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r--gcc/collect2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index bfa9155..cd269c4 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -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.