From 7e03d4385f8d2a46ea41cd85b6bee316f8c9f0b6 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 28 May 2026 17:24:38 +0800 Subject: [PATCH] riscv: Set undefined symbol value to 0 if pointer equality isn't needed This fixes: FAIL: Build pr29655 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Set undefined symbol value to 0 if pointer equality isn't needed. Signed-off-by: H.J. Lu --- bfd/elfnn-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 8f8a716ef52..dcde2362c2f 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -3555,7 +3555,7 @@ riscv_elf_finish_dynamic_symbol (bfd *output_bfd, Otherwise, the PLT entry would provide a definition for the symbol even if the symbol wasn't defined anywhere, and so the symbol would never be NULL. */ - if (!h->ref_regular_nonweak) + if (!h->ref_regular_nonweak || !h->pointer_equality_needed) sym->st_value = 0; } } -- 2.54.0