riscv: Set undefined symbol value to 0 if pointer equality isn't needed
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
Commit Message
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.
From 7e03d4385f8d2a46ea41cd85b6bee316f8c9f0b6 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
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 <hjl.tools@gmail.com>
---
bfd/elfnn-riscv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -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