> But I wonder how U-Boot managed to work on RISC-V till today? Hm. I think that linker relaxations may also have been disabled by linking with -pie. When I discovered this bug, I had disabled the flag since I was having a hard time getting my compiler to build with --enable-shared. When recompiling with -pie and with __global_pointer defined, the problem assembly code I noticed now uses the two-instruction auipc/lw sequence.
--Sean