RISC-V: Protect .got with relro
authorAndreas Schwab <schwab@suse.de>
Thu, 21 Sep 2023 14:49:41 +0000 (16:49 +0200)
committerAndreas Schwab <schwab@suse.de>
Mon, 25 Sep 2023 10:36:58 +0000 (12:36 +0200)
commit7345d05aafde53a48d5a587a6d9c1778db78e0f3
tree2402f4d9ecda856d80e8fc4f1ce1c54b8609baab
parenta47d304b1229ecf8912fac17ee9c48d1bf3c729a
RISC-V: Protect .got with relro

Move .got before .data so that it can be protected with -zrelro.  Also
separate .got.plt from .got if -znow is not in effect; the first two words
of .got.plt are placed within the relro region.

ld:
PR ld/30877
* emulparams/elf32lriscv-defs.sh (DATA_GOT, SEPARATE_GOTPLT):
Define.
* emulparams/elf64lriscv-defs.sh (SEPARATE_GOTPLT): Define.
* testsuite/ld-elf/binutils.exp (binutils_test): Remove riscv*-*-*
from relro_got expression.
ld/emulparams/elf32lriscv-defs.sh
ld/emulparams/elf64lriscv-defs.sh
ld/testsuite/ld-elf/binutils.exp