Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Not a valid dynamic program", Linux-loader cannot recognize EXEC:executable type ELF #180

Open
elliott10 opened this issue Sep 25, 2020 · 1 comment

Comments

@elliott10
Copy link
Collaborator

Linux-loader cannot recognize EXEC:executable type ELF.
When trying to run an executable ELF, encountered error: "Not a valid dynamic program"
Aflter I compiled an shared object type ELF with -pie -fPIE parameters, linux-loader works nomally.

  • ELF 64-bit LSB executable
    Compilation parameters: -no-pie
$ file rootfs/bin/testrandom
rootfs/bin/testrandom: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, for GNU/Linux 2.6.32
$ target/release/linux-loader /bin/testrandom
/lib/ld-musl-x86_64.so.1: /bin/testrandom: Not a valid dynamic program
  • ELF 64-bit LSB shared object
    Compilation parameters: -pie -fPIE
$ file rootfs/bin/testrandom
rootfs/bin/testrandom: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, for GNU/Linux 2.6.32
$ target/release/linux-loader /bin/testrandom
random: 79041041
@elliott10
Copy link
Collaborator Author

elliott10 commented Jul 25, 2023

关于交叉编译busybox

busybox 默认会编译成 dynamically linkedDYN (Shared object file)的类型;

而当加入参数-no-pie后,会编译成statically linkedEXEC (Executable file)类型;

两种类型都可由rCore加载进入sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant