Re: kldload exec format error on amd64 freebsd-7.1-rc2

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Tue, 20 Jan 2009 21:19:03 +0000 (GMT)
On Tue, 20 Jan 2009, Dag-Erling Smørgrav wrote:

> Barney Cordoba <barney_cordoba_at_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
Received on Tue Jan 20 2009 - 20:19:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:40 UTC