Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 2009 21:19:03 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        barney_cordoba@yahoo.com, freebsd-current@freebsd.org, Christof Schulze <christof.schulze@gmx.net>
Subject:   Re: kldload exec format error on amd64 freebsd-7.1-rc2
Message-ID:  <alpine.BSF.2.00.0901202110470.16213@fledge.watson.org>
In-Reply-To: <864oztrflu.fsf@ds4.des.no>
References:  <417204.17745.qm@web63906.mail.re1.yahoo.com> <864oztrflu.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
  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 <barney_cordoba@yahoo.com> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0901202110470.16213>