From grog@freebie.lemis.com  Sun Dec 27 18:59:44 1998
Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA11810
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Dec 1998 18:59:41 -0800 (PST)
          (envelope-from grog@freebie.lemis.com)
Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137])
	by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id NAA26487
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Dec 1998 13:29:09 +1030 (CST)
Received: (from grog@localhost)
	by freebie.lemis.com (8.9.1/8.9.0) id NAA30101;
	Mon, 28 Dec 1998 13:29:11 +1030 (CST)
Message-Id: <199812280259.NAA30101@freebie.lemis.com>
Date: Mon, 28 Dec 1998 13:29:11 +1030 (CST)
From: Greg Lehey <grog@lemis.com>
Reply-To: grog@lemis.com
To: FreeBSD-gnats-submit@freebsd.org
Subject:
X-Send-Pr-Version: 3.2

>Number:         9214
>Category:       bin
>Synopsis:       kldload(8) error messages are inadequate and misleading
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 27 19:00:00 PST 1998
>Closed-Date:    Mon Apr 24 10:08:28 PDT 2000
>Last-Modified:  Mon Apr 24 10:08:55 PDT 2000
>Originator:     Greg Lehey
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
LEMIS
>Environment:

	FreeBSD 3.0-CURRENT

>Description:

	When kldload(8) fails, the error messages are less than helpful:

	# kldload Vinum.ko
	kldload: can't load Vinum.ko: Exec format error
	# file Vinum.ko
	Vinum.ko: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), not stripped

	It appears that Vinum.ko contains unresolved references,
	though this is not completely clear; at any rate, this message
	occurs when there are unresolved references.  It also occurs,
	however, when the object file doesn't exist:

	# kldload foo.bar
	kldload: can't load foo.bar: Exec format error
	# file foo.bar
	foo.bar: can't stat `foo.bar': No such file or directory.

	In the case of unresolved references, it should be possible to
	return a specific error message and to identify the symbols
	which are not resolved.  nm(1) doesn't do this effectively,
	since the kld contains unresolved references to the kernel.
	modload(8) used to produce lists of unresolved symbols, but
	it's probable that this is not a useful option for kldload.
	In this case, a standalone program should be available.

	I've entered this problem as `serious' and `high priority',
	since the current situation is a regression from the previous
	lkm functionality, and there is now no alternative to klds.

>How-To-Repeat:

	As shown above.

>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sat Jan 2 12:05:23 PST 1999 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->closed 
State-Changed-By: dfr 
State-Changed-When: Mon Apr 24 10:08:28 PDT 2000 
State-Changed-Why:  
Fixed in link_elf.c revision 1.25 
>Unformatted:
