Re: Bug#697270: PC 32-bit programs fails to work on amd64
Timo Weingärtner <firstname.lastname@example.org> writes:
> Hallo Russ Allbery,
>> I think that's asking quite a lot of bash. Wouldn't it have to open
>> the binary and parse the ELF headers, extracting the INTERP header, in
>> order to verify that? Does it really make sense to encode
>> understanding of ELF binary layout formats in bash?
> As seen in strace bash already checks for existance of the script and
> the #!interpreter. So when execve threw a ENOENT ("The file filename or
> a script or ELF interpreter does not exist, or a shared library needed
> for file or interpreter cannot be found.") it could at least say
> something like "interpreter or libs not found, try ldd for debugging".
Hm, yes, I suppose that's true. There's a race condition when the binary
is deleted between the ENOENT failure and the subsequent check, but
apparently bash is already living with that for the shell script check.
Okay, good point.
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>