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

Disable linker relaxed addressing when loading gp #137

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions arch/risc-v/src/mpfs/mpfs_opensbi_trap.S
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ mpfs_global_pointer:

/* Restore GP */

la a0, mpfs_global_pointer
ld gp, 0(a0)
.option push
.option norelax
la gp, __global_pointer$
.option pop

/* Call C routine */

Expand Down
7 changes: 0 additions & 7 deletions arch/risc-v/src/mpfs/mpfs_opensbi_utils.S
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ mpfs_opensbi_prepare_hart:
la t0, mpfs_exception_opensbi
csrw mtvec, t0

/* la gp, __global_pointer$ will not work. We want to have the gp as seen
* in the .map file exactly. We need to restore gp in the trap handler.
*/

la t0, mpfs_global_pointer
ld gp, 0(t0)

/* Setup stacks per hart, the stack top is the end of the hart's scratch */

csrr a0, mhartid
Expand Down
Loading