From owner-freebsd-current@FreeBSD.ORG Tue Jan 20 21:19:04 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 011221065695 for ; Tue, 20 Jan 2009 21:19:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CBECA8FC0A for ; Tue, 20 Jan 2009 21:19:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 723D146B37; Tue, 20 Jan 2009 16:19:03 -0500 (EST) Date: Tue, 20 Jan 2009 21:19:03 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= In-Reply-To: <864oztrflu.fsf@ds4.des.no> Message-ID: References: <417204.17745.qm@web63906.mail.re1.yahoo.com> <864oztrflu.fsf@ds4.des.no> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-598408371-1232486343=:16213" Cc: barney_cordoba@yahoo.com, freebsd-current@freebsd.org, Christof Schulze Subject: Re: kldload exec format error on amd64 freebsd-7.1-rc2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 21:19:04 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --621616949-598408371-1232486343=:16213 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 20 Jan 2009, Dag-Erling Smørgrav wrote: > Barney Cordoba writes: >> Is there any interest in fixing this stupid and wrong error message to be >> something like "unresolved externals" at some point? > > When the kernel fails to load a module, kldload(2) returns ENOEXEC, which > strerror(3) translates to "exec format error". If you can think of a better > errno value to use, feel free to send patches. The only alternatives I can > think of are ENOSYS (ambiguous) and EFTYPE (just as vague as ENOEXEC). A number of other UNIXy OS's have extended the errno space to support user linker errors in a bit more detail, it could be that we could reuse/abuse a few of them: ELIBACC Solaris/Linux Can't access needed shared lib ELIBBAD Solaris/Linux Accessing a corrupted shared lib ELIBSCN Solaris/Linux .lib section in a.out corrupted ELIBMAX Solaris/Linux Attempting to link in too many libs ELIBEXEC Solaris/Linux Attempting to exec a shared library EBADEXEC Mac OS X Bad excutable EBADARCH Mac OS X Bad CPU type in executable ESHLIBVERS Mac OS X Shared library version mismatch Or, we could add a couple of new errno values. This has come up a number of times and people do find it confusing that the errors returned aren't very related to the error. Another alternative would be to add a new kldload() system call that explicitly returns a more detailed error number space independent of the errno space. Robert --621616949-598408371-1232486343=:16213--