Dumb bug in weak support
Jeffrey A Law
law@cygnus.com
Wed Jun 9 12:26:00 GMT 1999
Linux strcmp blows up if one of the arguments to strcmp is a null pointer.
This fixes a bootstrap failure on ppc-linux.
* varasm.c (remove_from_pending_weak_list): Verify t->name
is non-NULL before passing it to strcmp.
Index: varasm.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/varasm.c,v
retrieving revision 1.59.4.3
retrieving revision 1.59.4.4
diff -c -r1.59.4.3 -r1.59.4.4
*** varasm.c 1999/06/07 19:46:11 1.59.4.3
--- varasm.c 1999/06/09 12:13:49 1.59.4.4
***************
*** 4388,4394 ****
struct weak_syms *t;
for (t = weak_decls; t; t = t->next)
{
! if (strcmp (name, t->name) == 0)
t->name = NULL;
}
}
--- 4388,4394 ----
struct weak_syms *t;
for (t = weak_decls; t; t = t->next)
{
! if (t->name && strcmp (name, t->name) == 0)
t->name = NULL;
}
}
More information about the Gcc-patches
mailing list