旧的ARM32二进制文件可以在AARCH64内核上运行吗? [英] Can old ARM32 binary files be run on AARCH64 kernel?

查看:782
本文介绍了旧的ARM32二进制文件可以在AARCH64内核上运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对在AARCH64-Linux机器上运行旧的ARM32-Linux程序的可行性感到好奇,并进行了一些实验:

I am curious about the feasibility of running old ARM32-Linux programs on AARCH64-Linux machines and I conducted some experiments:

  1. 编写一个程序"Hello,World!"并使用arm-none-linux-gnueabi-gcc和aarch64-linux-gnu-gcc进行静态编译.
  2. 使用busybox和aarch64编译器静态构建和创建ramdisk.
  3. 输入2你好,世界!"程序(在ARM32和AARCH64中)到ramdisk.
  4. 使用vexpress_defconfig和aarch64编译器构建一个简单的AARCH64-Linux内核.
  5. 使用qemu-system-aarch64运行内核和ramdisk.

(ramdisk中的所有二进制文件(包括busybox)都被静态编译.)

(All binary files including busybox in the ramdisk are statically compiled.)

结果:

  1. 你好,世界!" AARCH64中的程序已成功执行.
  2. 你好,世界!" ARM32中的程序无法运行,但显示以下消息:

第1行:语法错误:意外的单词(预期为)")

line 1: syntax error: unexpected word (expecting ")")

是否有解决上述问题的建议或专业知识?

Is there suggestion or expertise to solve the issue above?

推荐答案

谢谢moonbutt74.您为我提供了一个有用的线索,以寻求解决该问题的方法.

Thank you moonbutt74. You had provided an useful clue for me to seek the solution to that issue.

要在AARCH64内核上启用运行ARM32-Linux程序的支持,应选择内核中的选项:

To enable the support of running ARM32-Linux programs on AARCH64 kernel, the option in the kernel should be selected:

  1. 运行make menuconfig ARCH = arm64
  2. 转到该选项并选择它:

用户空间二进制格式 --->内核支持32位EL0

Userspace binary formats ---> Kernel support for 32-bit EL0

  1. 通过运行make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

使用ramdisk和qemu-system-aarch64运行重新编译的内核.

run the recompiled kernel with ramdisk and qemu-system-aarch64.

你好,世界!" (ARM32和AARCH64)中的程序可以成功执行!

the "Hello, World!" programs in (ARM32 and AARCH64) can be executed successfully !!

这篇关于旧的ARM32二进制文件可以在AARCH64内核上运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆