]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_name
authorMark Wielaard <mark@klomp.org>
Thu, 4 Jan 2024 00:31:31 +0000 (01:31 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 15 Jan 2024 13:01:15 +0000 (14:01 +0100)
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.

bfd/elfnn-riscv.c

index fa03d1a53ec9b051587eee44b04db89861c3e04d..8b27e3b8d6aef4f1375bcaff5d2e61a885ee72ee 100644 (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);