Closed bj-wanghz closed 4 years ago
This distribution uses the same sources and build options like the SiFive public distribution.
Please check if the issue is also present in the SiFive distribution.
The problem has been solved. There are jal
instruction in these .S files. When the code size becomes large, the targets of jal
may be beyond the address range it can access. Then the errors generate. call
or tail
should be used to invoke an external routine.
I presume that this relates to the same issue?
https://forums.sifive.com/t/link-error-relocation-truncated-to-fit-r-riscv-jal-against-symbol/4163
Thank you for letting us know, your explanation might help other having the same problem.
Description
When building from my code, I got the following linkage errors with
-O0 -ggdb
options, while the building process would be done using only-Os
and no-ggdb
option.I posted an issue on Sifive Forum. And
Jim Wilson
guessed that maybe it has been fixed in some commit last year. I'm not sure if the Xpack version has included that.Steps to Reproduce
Sorry, I cannot provide a testcase for now. As my code reproducing the problem is my whole product project.
Versions
xPack GNU RISC-V Embedded GCC v8.3.0-2.3