[PATCH] D149526: [JITLink][RISCV] Implement linker relaxation
Jonas Hahnfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 18 11:09:30 PDT 2023
Hahnfeld added a comment.
In D149526#4353336 <https://reviews.llvm.org/D149526#4353336>, @jobnoorman wrote:
> Thanks for reporting this, @Hahnfeld. Was this working before?
Yes, it was working before, and still is working for me without `-mattr=+relax`.
> $ lli -jit-linker=jitlink test.ll
> JIT session error: In graph __standard_lib-jitted-objectbuffer, section .text: relocation target "__lljit.platform_support_instance" at address 0x40054e0cd0 is out of range of R_RISCV_HI20 fixup at 0x4008266008 (__lljit_run_atexits, 0x4008266000 + 0x8)
> JIT session error: In graph __standard_lib-jitted-objectbuffer, section .text: relocation target "__lljit.platform_support_instance" at address 0x40054e0cd0 is out of range of R_RISCV_HI20 fixup at 0x4008268008 (__lljit_run_atexits, 0x4008268000 + 0x8)
> ./lli: Failed to materialize symbols: { (<Platform>, { __lljit_run_atexits, atexit, __dso_handle }) }
> Failed to materialize symbols: { (main, { __lljit_run_atexits, atexit, __dso_handle }) }
In D149526#4353688 <https://reviews.llvm.org/D149526#4353688>, @jobnoorman wrote:
> @Hahnfeld: the issue seems to be that by default, non-PIC code is generated. Adding `--relocation-model=pic` to the `lli` command line solves the issue for me.
This is because you're explicitly specifying `-jit-linker=jitlink`, then it doesn't default to PIC. If you don't specify anything, you'll still get JITLink (there is nothing else for RISC-V) and PIC by default. Then the test case works without linker relaxation, but you should see the error I posted above with `-mattr=+relax`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149526/new/
https://reviews.llvm.org/D149526
More information about the llvm-commits
mailing list