bfd: riscv_maybe_function_sym check _bfd_elf_is_local_label_name
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Testing passed
|
Commit Message
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 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
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);
Hi Mark,
> 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?
Approved - please apply.
Cheers
Nick
@@ -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);