[Bug target/122538] [SPARC64] GCC uses the wrong source registers for R_SPARC_GOTDATA_OP relocations
koachan+gccbugs at protonmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 4 00:02:28 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122538
--- Comment #2 from Koakuma <koachan+gccbugs at protonmail dot com> ---
(In reply to Eric Botcazou from comment #1)
> The name of the register does not matter, only its value; in other words,
> the code is correct if %g1 contains the value computed in %g2 earlier.
>
> R_SPARC_GOTDATA_OP simply says "change ldx to add" if the symbol is not
> located too far from the GOT, whatever registers are used in the
> instructions; they just need to be preserved. See the implementation in
> bfd/elfxx-sparc.c for the GNU linker.
Ah, I see, so spilling/filling/copying around the register should be okay.
Thank you, I've told the mold folks about this.
More information about the Gcc-bugs
mailing list