aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@rivosinc.com>2022-01-13 18:10:19 -0800
committerPalmer Dabbelt <palmer@rivosinc.com>2022-02-24 11:29:43 -0800
commit8645370af18979123d9e94e3ed215d23dd740721 (patch)
treecef8546b2f5bbe7cba88f1c5ffc8ee52e51dc69b /gcc/expr.cc
parent157cc4e0117756503c7c63df97cf31de7570b088 (diff)
downloadgcc-8645370af18979123d9e94e3ed215d23dd740721.zip
gcc-8645370af18979123d9e94e3ed215d23dd740721.tar.gz
gcc-8645370af18979123d9e94e3ed215d23dd740721.tar.bz2
RISC-V: Document the degree of position independence that medany affords
The code generated by -mcmodel=medany is defined to be position-independent, but is not guaranteed to function correctly when linked into position-independent executables or libraries. See the recent discussion at the psABI specification [1] for more details. It would be better to reject these invalid sequences when linking, but as pointed out in a recent LD bug [2] there may be some compatibility issues related to the PCREL_HI20 relocations used to initialize GP. Given the complexity here it's unlikely we'll be able to reject these sequences any time soon, so instead just document that these may not work. [1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/245 [2]: https://sourceware.org/bugzilla/show_bug.cgi?id=28789 gcc/ChangeLog: * doc/invoke.texi (RISC-V -mcmodel=medany): Document the degree of position independence that -mcmodel=medany affords. Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions