rcore-os / zCore

Zircon microkernel reimplemented in Rust.
MIT License
1.71k stars 208 forks source link

Error: in LibOS mode, static app runs with segment fault. #211

Open chyyuu opened 3 years ago

chyyuu commented 3 years ago

e.g.

chyyuu:zCore$ cargo run --release -p linux-loader -- /libc-test/src/functional/argv-static.exe Finished release [optimized] target(s) in 0.03s Running target/release/linux-loader /libc-test/src/functional/argv-static.exe 段错误 (核心已转储) chyyuu:zCore$

I also notice:

scripts/libc-tests.py

L22~24:

ignore static linked tests

if path.endswith('-static.exe'):
    continue

These codes mean LibOS mode zCore didn't support static linked tests?

wangrunji0408 commented 3 years ago

Yes. LibOS can only run dynamic linked programs because we have to modify libc.so (syscall -> function call). Static linked programs have syscall instructions in their binary files.

chyyuu commented 3 years ago

Thank you. I guess: If we build static apps with modified libc .a (syscall --> function call), then these static apps should work correctly.