JAL 1Mib jump

HI,
I get the below error:
relocation truncated to fit: R_RISCV_JAL

when I try to jump to 1Mib using JAL.
How to resolve this.

code:
jal 1f
1:
jal x5, 2f
.fill (1024*1024),1,0
2:
#more code

You need to review and understand the capabilities of the RISC-V JAL instruction and then take steps to deal with the limitations of the “jump distance” - e.g. by “trampolining” or similar if necessary. Alternatively, write your code in a high level language such as C/C++ and let the compiler/linker deal with the issue.