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

LLD crash: Inserting c.j Reset at Entry point instead of jal zero, Reset #2

Open
aurabindo opened this issue Mar 4, 2019 · 0 comments

Comments

@aurabindo
Copy link
Contributor

I tried the following change in global_asm where I renamed the original Reset in the example to Premain.
The linker is crashing :

global_asm!(r#"
.section .text
global Reset
Reset:
.option rvc
	c.j Premain

.globl abort
abort:
  jal zero, abort
"#);

But the linker crashes:

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name rust_picosoc src/main.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="simple_uart"' -C metadata=8032c5e0bc7a6620 -C extra-filename=-8032c5e0bc7a6620 --out-dir /media/aj/Buffer/git-clones/picosoc-example/target/riscv32imac-unknown-none-elf/release/deps --target riscv32imac-unknown-none-elf -L dependency=/media/aj/Buffer/git-clones/picosoc-example/target/riscv32imac-unknown-none-elf/release/deps -L dependency=/media/aj/Buffer/git-clones/picosoc-example/target/release/deps --extern panic_abort=/media/aj/Buffer/git-clones/picosoc-example/target/riscv32imac-unknown-none-elf/release/deps/libpanic_abort-7fe772e4504c44d7.rlib --extern r0=/media/aj/Buffer/git-clones/picosoc-example/target/riscv32imac-unknown-none-elf/release/deps/libr0-a508df8919a0e554.rlib --extern volatile_register=/media/aj/Buffer/git-clones/picosoc-example/target/riscv32imac-unknown-none-elf/release/deps/libvolatile_register-819b7aad3e10e33f.rlib -C link-arg=-Tlink.x` (signal: 11, SIGSEGV: invalid memory reference)

Am I doing it right, or should it be done in another way ? main.rs: https://pastebin.com/7AfTcNV1

@aurabindo aurabindo changed the title Inserting c.j Reset instruction at Entry point instead of jal zero, Reset LLD crash: Inserting c.j Reset at Entry point instead of jal zero, Reset Mar 4, 2019
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