Skip to content

Commit 7638761

Browse files
committed
Surround use of absolute offset with "norelax"
This prevents an unsupported `R_RISCV_ALIGN` relocation from being generated by disabling link-time relaxing for the appropriate part. Fixes #55.
1 parent 158d964 commit 7638761

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

riscv-rt/asm.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ _start:
3030

3131
// for 64bit
3232
.if __riscv_xlen == 64
33+
.option push
34+
.option norelax // to prevent an unsupported R_RISCV_ALIGN relocation from being generated
3335
1:
3436
auipc ra, %pcrel_hi(1f)
3537
ld ra, %pcrel_lo(1b)(ra)
3638
jr ra
3739
.align 3
3840
1:
3941
.dword _abs_start
42+
.option pop
4043
.endif
4144

4245
_abs_start:

0 commit comments

Comments
 (0)