[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: No "cannot execute binary file" for x86 binaries?



On Fri, Jun 04, 2004 at 01:59:19PM -0600, Bob Proulx wrote:
> On an ia64 machine running Bdale's ia64 kernel build of linux 2.4.19
> and bash 2.05b-2woody3:
> 
>   $ ./hppa/executable ; echo $?
>   -bash: ./hppa/executable: cannot execute binary file
>   126
> 
> All well and good and expected.  But the following is different:
> 
>   $ ./ia32/executable ; echo $?
>   127
> 
> There is no message.  Shouldn't this produce a similar error to the
> one above?  Note that I do not have an emulation layer installed.

Right, but I bet you have CONFIG_IA32_SUPPORT turned on.  So the code
path is rather different (see fs/exec.c:search_binary_handler()).  For
the PA code, you're getting -ENOEXEC back.  For the x86 code, this is
a simple matter of not finding the dynamic loader / libs required for
this executable.  I don't know why bash isn't printing an error message
for this case -- possibly stracing might help?

> Any hints on how to improve this situation?  An error message in
> addition to the return code would be good.  Yes there is an error
> code.  But lack of a message from bash is definitely confusing to the
> typical user.
> 
> Of course if the emulation layer is installed then things run fine.
> But that is not always appropriate.
> 
> Thanks
> Bob



-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain



Reply to: