linux 错误码 65280,Android:无法在同一部手机上执行通过Linux部署编译的文件

root@hammerhead:/data/local # ./HelloWorld

tmp-mksh: ./HelloWorld: No such file or directory

Hello!

你好!

I compiled using gcc on Linux Deploy, which as I understand downloads Ubuntu and chroots into the environment. The file runs fine inside of this chroot environment.

我在Linux部署中使用gcc进行编译,据我所知,它将Ubuntu和chroots下载到环境中。该文件在这个chroot环境中运行良好。

As I understand this error is given when the file doesn't match the architecture of the machine. But it is running on the same machine! Does anyone know why this may be happening?

我理解这个错误是在文件与机器的架构不匹配时给出的。但它在同一台机器上运行!有人知道为什么会这样吗?

File permissions, ownership and context:

文件权限、所有权和上下文:

-rwxrwxrwx root root u:object_r:system_data_file:s0 HelloWorld

Id output:

Id输出:

uid=0(root) gid=0(root) context=u:r:init:s0

Using /system/bin/sh

使用/系统/ bin / sh

/system/bin/sh: ./Helloworld: No such file or directory

Trying to execute a non existant file:

尝试执行一个不存在的文件:

/system/bin/sh: ./test: not found

1 个解决方案

#1

2

You should compile your binary with gcc '-static' key. If you don't do that, you binary will need dynamic linker ld.so that doesn't exist on Android (but definitely exists inside your chroot!). This implies that strange error message "No such file or directory".

你应该用gcc的静态键来编译你的二进制文件。如果您不这样做,您的二进制文件将需要动态链接器ld。因此,Android上不存在动态链接器ld。这意味着奇怪的错误消息“没有这样的文件或目录”。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值