The following patch has been recently merged in binutils: 7345d05aafde53a48d5a587a6d9c1778db78e0f3 is the first bad commit commit 7345d05aafde53a48d5a587a6d9c1778db78e0f3 Author: Andreas Schwab <schwab@suse.de> Date: Thu Sep 21 16:49:41 2023 +0200 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 | 4 ++++ ld/emulparams/elf64lriscv-defs.sh | 1 + ld/testsuite/ld-elf/binutils.exp | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) It causes the elf/audit1 elf/tst-audit2 elf/tst-audit8 glibc tests to fail with a segmentation fault if configured with --enable-bind-now. It appears to be a bug in glibc.
riscv is missing all of the required profile/audit setup.
(In reply to Andreas Schwab from comment #1) > riscv is missing all of the required profile/audit setup. Thanks for looking at that, it makes sense. Do you plan to work on that, or should I look what I can do?
The master branch has been updated by Aurelien Jarno <aurel32@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6b32696116e0097f5dd578ec087bcbef483f2a07 commit 6b32696116e0097f5dd578ec087bcbef483f2a07 Author: Aurelien Jarno <aurelien@aurel32.net> Date: Sat Dec 30 11:00:10 2023 +0100 RISC-V: Add support for dl_runtime_profile (BZ #31151) Code is mostly inspired from the LoongArch one, which has a similar ABI, with minor changes to support riscv32 and register differences. This fixes elf/tst-sprof-basic. This also fixes elf/tst-audit1, elf/tst-audit2 and elf/tst-audit8 with recent binutils snapshots when --enable-bind-now is used. Resolves: BZ #31151 Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Fixed in glibc master.