Subject: misc/12755: bug of ld.elf_so
To: None <gnats-bugs@gnats.netbsd.org>
From: H.Saito <saito@densan.co.jp>
List: netbsd-bugs
Date: 04/25/2001 19:41:31
>Number:         12755
>Category:       misc
>Synopsis:       bug of ld.elf_so
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 25 21:55:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     H.Saito
>Release:        1.5
>Organization:
>Environment:
DCP-R5000/30(DENSAN Compact-PCI bus Board)
System: NetBSD vw5 1.5 NetBSD 1.5 (GENERIC) #14: Tue Apr 17 11:31:40 JST 2001 saito@vw4:/user5/NetBSD-1.5/usr/src/sys/arch/devos/compile/GENERIC devos

>Description:
        If pointers of def and ref of _rtld_find_symdef() at
        src/libexec/symbol.c are NULL, dynamic loader ld.elf_so dump core.

>How-To-Repeat:
>Fix:
--- symbol.c.org	Tue Oct 17 07:07:04 2000
+++ symbol.c	Thu Apr 19 18:22:07 2001
@@ -226,7 +226,7 @@
 	 * 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;
 	}
>Release-Note:
>Audit-Trail:
>Unformatted: