diff --git a/tools/bits-info.sh b/tools/bits-info.sh index 6b4f1500..784a7ec8 100755 --- a/tools/bits-info.sh +++ b/tools/bits-info.sh @@ -309,13 +309,18 @@ main() _limits_date='32767 2147480047 2147483647 32535215999 32535244799 67767976233529199 67767976233532799 67768036191673199 67768036191676799 9223372036854775807' _limits_u='65535 2147483647 2147483648 4294967295 18446744073709551615' - shell_exe="$(readlink 2> /dev/null "/proc/${$}/exe")" || shell_exe='' + shell_exe="$(readlink 2> /dev/null "/proc/${$}/exe")" || shell_exe='x' shell_info="$(get_shell_info || true)" shell_name="$(printf '%s\n' "${shell_info:?}" | cut -d ' ' -f '1' || true)" echo "_${shell_exe?}_" -check_bitness_of_pe_file "${shell_exe:?}" +ls -l /proc/$$/path/a.out || true +stat /proc/$$/path/a.out || true +readlink /proc/$$/path/a.out || true +echo '===' + +test -n "${shell_exe?}" && check_bitness_of_pe_file "${shell_exe:?}" if test -n "${shell_exe?}" && tmp_var="$(hexdump 2> /dev/null -v -n 5 -e '/1 "%02x"' -- "${shell_exe:?}")" && test -n "${tmp_var?}" && printf '%s\n' "${tmp_var:?}" | grep -m 1 -q -e '^7f454c46'; then # On Linux / Android # ELF header => 0x7F + ELF (0x45 0x4C 0x46) + 0x01 for 32-bit or 0x02 for 64-bit