我已经设置了一个新环境 - 它是一个在 Chromebook(Asus Flip C100P - 基于 ARM)中包含 Ubuntu 14.04(可信赖)的 chroot。我已经安装了 gcc 和 g++。我创建了一个简单的“hello, world”程序(test.c)并通过以下方式编译它:
gcc -o t.exe test.c
当我运行 ./t1.exe 时,我得到以下信息:
bash: ./t.exe: Permission denied
请注意,我以 root 身份执行,并且 ./t.exe 的权限设置为完全开放(chmod 777,通过 ls -l 验证)。
所以我尝试确定出了什么问题 - 这是我尝试过的:
% 文件 ./t.exe
./t.exe: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=82a6c6227e0f7171a68c71a74c6e6396e37e6675, not stripped
%ldd ./t.exe
not a dynamic executable
% readelf -d ./t.exe | 需要 grep
0x00000001 (NEEDED) Shared library: [libc.so.6]
% dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii libc6:armhf 2.19-0ubuntu armhf Embedded GNU C Library: Shared li
% 猫 /etc/ld.so.conf.d/*
# Multiarch support
/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf/mesa-egl
/usr/lib/arm-linux-gnueabihf/mesa
/usr/lib/arm-linux-gnueabihf/libfakeroot
# libc default configuration
/usr/local/lib
% ls -l libc.so.6
lrwxrwxrwx 1 root root 14 Aug 12 19:37 libc.so.6 -> /lib/libc.so.6
% ls -l /usr/local/lib/libc.so.6
lrwxrwxrwx 1 root root 14 Aug 12 18:21 /usr/local/lib/libc.so.6 -> /lib/libc.so.6
% ls -l /usr/lib/libc.so.6
lrwxrwxrwx 1 root root 14 Aug 12 19:37 /usr/lib/libc.so.6 -> /lib/libc.so.6
% ls -l /lib/libc.so.6
lrwxrwxrwx 1 root root 34 Aug 12 18:11 /lib/libc.so.6 -> /lib/arm-linux-gnueabihf/libc.so.6
% ls -l /lib/arm-linux-gnueabihf/libc.so.6
lrwxrwxrwx 1 root root 12 May 26 07:55 /lib/arm-linux-gnueabihf/libc.so.6 -> libc-2.19.so
% ls -l /lib/arm-linux-gnueabihf/libc-2.19.so
-rwxr-xr-x 1 root root 902876 May 26 07:56 /lib/arm-linux-gnueabihf/libc-2.19.so
% objdump -a /lib/arm-linux-gnueabihf/libc-2.19.so
/lib/arm-linux-gnueabihf/libc-2.19.so: file format elf32-littlearm
/lib/arm-linux-gnueabihf/libc-2.19.so
% objdump -a ./t.exe
./t.exe: file format elf32-littlearm
./t.exe
% unname -a
Linux localhost 3.14.0 #1 SMP PREEMPT Tue Aug 2 21:07:06 PDT 2016 armv7l armv7l armv7l GNU/Linux
我怀疑我有一个破旧的工具链,但在这一点上我真的很难过。
有没有人对这里发生的事情或如何继续寻找问题有任何想法?