1

为什么这甚至可以在我的 Intel i5 上运行?为什么我可以本地执行它?

# riscv64-linux-gnu-gcc-7 hello.c -o hello -static
# ./hello 
Hello World!
# file hello
hello: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), statically linked, for GNU/Linux 4.15.0, BuildID[sha1]=519dabc53e2d6cccc48750975ee60000263d0c95, not stripped
4

1 回答 1

2

那是因为binfmt_misc。IOW,在系统中注册了一个模拟器,运行为其他架构编译的程序。

于 2019-03-12T07:31:25.387 回答