Skip to content

Commit

Permalink
Disable linker relaxed addressing when loading gp
Browse files Browse the repository at this point in the history
  • Loading branch information
jnippula committed Aug 9, 2023
1 parent b999c4e commit 6b37e74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
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

0 comments on commit 6b37e74

Please sign in to comment.