[PATCH] bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_name
Mark Wielaard
mark@klomp.org
Fri Jan 12 14:42:16 GMT 2024
On Thu, 2024-01-04 at 01:31 +0100, Mark Wielaard wrote:
> 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.
Ping. OK to push?
> ---
> bfd/elfnn-riscv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
> index 509d61e5017..15c7fa3f89e 100644
> --- a/bfd/elfnn-riscv.c
> +++ b/bfd/elfnn-riscv.c
> @@ -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);
More information about the Binutils
mailing list