Subject: everything dumps core on mips with new libc fix.
To: None <port-mips@NetBSD.ORG, tech-toolchain@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-toolchain
Date: 08/29/2001 00:24:45
I've tracked down the problem with mips programs dumping core once a new
libc (or other dependant library) is installed to the following section
of code in ld.elf_so.  I can offer no explanation as to why both def
and ref are NULL in this section of code and why the circumstances of
mixing new init/fini shared libraries and old crt0.o's end up with this
situation.

That said, the following _seems_ to fix the problems.  I've installed a
new set of shared libraries and am still using old userland binaries.

I'm not going to commit this given my complete non-understanding of what
is actually wrong.  Is anyone able to shed any light on this?

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/



Index: symbol.c
===================================================================
RCS file: /cvsroot/basesrc/libexec/ld.elf_so/symbol.c,v
retrieving revision 1.10
diff -d -p -u -r1.10 symbol.c
--- symbol.c	2000/10/11 20:46:08	1.10
+++ symbol.c	2001/08/28 14:14:57
@@ -226,7 +226,8 @@ _rtld_find_symdef(obj_list, r_info, name
 	 * If we found no definition and the reference is weak, treat the
 	 * symbol as having the value zero.
 	 */
-	if (def == NULL && ELF_ST_BIND(ref->st_info) == STB_WEAK) {
+	if (def == NULL &&
+	    ((ref != NULL) && ELF_ST_BIND(ref->st_info) == STB_WEAK)) {
 		def = &_rtld_sym_zero;
 		defobj = _rtld_objmain;
 	}