https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91602
--- Comment #6 from Jim Wilson <wilson at gcc dot gnu.org> --- By the way, the underlying problem here is, as Andrew Waterman mentioned, that the RISC-V linker does aggressive link time relaxations to reduce code size, and this makes lib128 with label subtraction unsafe. The RISC-V port is not the only port that has this problem. The RISC-V port is just the only one that gets it right. The others can silently produce incorrect debug info. I have evidence that every binutils target except RISC-V that does aggressive link time relaxation to reduce code size is doing it wrong. There is a bug in binutils bugzilla where I listed linker relaxation code size related issues, but I have since found and fixed other problems in the RISC-V port, so it is incomplete. https://sourceware.org/bugzilla/show_bug.cgi?id=22756#c2