Calling all RISC-V developers using the GNU toolchain.
I have some code like this in a foo.S file:
.extern PGM_START # ...etc... la a2,PGM_START
In the sections.lds linker script (passed via the riscv64-unknown-elf-ld -T flag), PGM_START is set to an address:
PGM_START = 0x28000;
When I assemble foo.S, I see it is expanded to something like this:
ld a2,0x28 addi a2,a2,-8
Where is this -8 offset coming from? This appears to be a failure of GNU ld to apply a relaxation. Except for manually replacing la with auipc, how can I convince ld that there is no -8 bias to that symbol?
Boosts welcome. I'm desparate at this point.