This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [OPCODES][AARCH64]Drop first symbol flavour check in print_insn_aarch64().

On 15 September 2015 at 14:11, Renlin Li <> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]