This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [OPCODES][AARCH64]Drop first symbol flavour check in print_insn_aarch64().
- From: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Renlin Li <renlin dot li at arm dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Nicholas Clifton <nickc at redhat dot com>
- Date: Wed, 16 Sep 2015 14:55:15 +0100
- Subject: Re: [OPCODES][AARCH64]Drop first symbol flavour check in print_insn_aarch64().
- Authentication-results: sourceware.org; auth=none
- References: <55F81919 dot 5090100 at arm dot com>
On 15 September 2015 at 14:11, Renlin Li <renlin.li@arm.com> wrote:
> This is a simple patch to remove the flavour check on the first symbol in
> print_insn_aarch64().
>
> It's a problem when the first symbol's flavour is not bfd_target_elf_flavour
> (and the target is elf). In my case, it's triggered in PLT section, with the
> first symbol being __tls_get_addr@plt. It's a synthetic symbol,
> bfd_target_unknown_flavour is returned. So the condition is always false.
> According to the code logic, it will not search the symbol table for proper
> mapping symbols, and the default mapping symbol(MAP_INSN) is always used.
- if (info->symtab_size != 0
- && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
+ if (info->symtab_size != 0)
This code was lifted from the ARM backend into the AArch64 backend.
I'm not entirely sure what the purpose of the flavour check is, but my
guess would be that it was intended as an optimization to prevent the
scan of the symbol table if there could be no mapping symbols present,
the change looks reasonable to me. Can you construct a test case to
demonstrate the fix works?
Presumably ARM back end suffers the same issue?
Cheers
/Marcus