Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

why i can not run program on my linux(qemu simulate arm32,and start a linux os)

【1】, I have a linux os environment, which is based on arm32(qemu similute).

【2】, There are two file in / directory. One is "init", and one is "nesoft", but i can only run "init", and i can not run "nesoft" :

/ # ./init This is initramfs - init !!!

/ # ./nesoft -/bin/sh: ./nesoft: not found

【3】, The two file have dirrerence below: zhang@zhang-Virtual-Machine:~/src/qemu/third_patry/rootfs/busybox/rootfs$ file init init: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=08c7f187d91207660caa2db0101980a1f4b12716, notd

zhang@zhang-Virtual-Machine:~/src/qemu/third_patry/rootfs/busybox/rootfs$ file nesoft nesoft: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 4.4.0, stripped

【4】, I have search ,so i think "LSB shared object" should run as executable file (I learn form https://unix.stackexchange.com/questions/472449/what-is-the-difference-between-lsb-executable-et-exec-and-lsb-shared-object ) BUT, why it still does not run ?

【END】 Has anyone meet this before, and know why ?

question from:https://stackoverflow.com/questions/65937882/why-i-can-not-run-program-on-my-linuxqemu-simulate-arm32-and-start-a-linux-os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The main difference I see that second file is dynamically linked which means it requires library .so files to execute. I suppose it just that can't load the dependency.

Try running ldd (or export LD_TRACE_LOADED_OBJECTS=1 before running your binary since ldd may not be on busybox) to see which library is missing.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...