How to run a dynamically linked executable syscall

2019-02-26 00:27发布

问题:

After How to solve "FATAL: kernel too old" when running gem5 in syscall emulation SE mode? I managed to run a statically linked hello world under certain conditions.

But if I try to run an ARM dynamically linked one against the stdlib with:

./out/common/gem5/build/ARM/gem5.opt ./gem5/gem5/configs/example/se.py -c ./a.out

it fails with:

fatal: Unable to open dynamic executable's interpreter.

How to make it find the interpreter? Hopefully without copying my cross' toolchain's interpreter on my host's root.

For x86_64 it works if I use my native compiler, and as expected strace says that it is using the native interpreter, but it does not work if I use a cross compiler.

The current FAQ says it is not possible to use dynamic executables: http://gem5.org/Frequently_Asked_Questions but I don't trust it, and then these presentations mention it:

  • http://www.gem5.org/wiki/images/0/0c/2015_ws_08_dynamic-linker.pdf
  • http://research.cs.wisc.edu/multifacet/papers/learning_gem5_tutorial.pdf

but not how to actually use it.

QEMU user mode has the -L option for that.

Tested in gem5 49f96e7b77925837aa5bc84d4c3453ab5f07408e

https://www.mail-archive.com/gem5-users@gem5.org/msg15582.html

回答1:

I have been told that as of 49f96e7b77925837aa5bc84d4c3453ab5f07408e (May 2018) there is no convenient / well tested way for running dynamically linked cross arch executables in syscall emulation: https://www.mail-archive.com/gem5-users@gem5.org/msg15585.html

I suspect however that it wouldn't be very hard to patch gem5 to support it.



标签: gem5