bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_name

This fixes the ld "Handle no DWARF information" testcase. Which
currently fails on riscv because a local label name is assumed
to be the current function name.

bfd/ChangeLog:

* elfnn-riscv.c (riscv_maybe_function_sym): Also check
	_bfd_elf_is_local_label_name.
This commit is contained in:
Mark Wielaard
2024-01-04 01:31:31 +01:00
parent 0796bfa487
commit 907aee5baf

View File

@@ -5452,7 +5452,8 @@ riscv_maybe_function_sym (const asymbol *sym,
bfd_vma *code_off)
{
if (sym->flags & BSF_LOCAL
&& riscv_elf_is_mapping_symbols (sym->name))
&& (riscv_elf_is_mapping_symbols (sym->name)
|| _bfd_elf_is_local_label_name (sec->owner, sym->name)))
return 0;
return _bfd_elf_maybe_function_sym (sym, sec, code_off);