Why can an aarch64 ELF executable be run on an x86_64 machine?
9
votes
1
answer
2159
views
I compiled a simple "Hello World" C program on Raspberry Pi 3, which was then transferred to an AMD64 laptop. Out of curiosity, I executed it, and it runs even though I did not expect it to:
$ uname -a
Linux 15ud490-gx76k 6.5.0-25-generic #25~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Feb 20 16:09:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ file hello64
hello64: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=486ee1cde035cd704b49c037a32fb77239b6a1c2, for GNU/Linux 3.7.0, not stripped
$ ./hello64
Hello World!
Like that, how can it execute?
QEMU User Emulation is installed, but I don't know whether it is playing a part in this or not.
Asked by pico
(150 rep)
Mar 10, 2024, 07:26 AM
Last activity: Mar 10, 2024, 05:57 PM
Last activity: Mar 10, 2024, 05:57 PM