[OPCODES][AARCH64]Drop first symbol flavour check in print_insn_aarch64().
Renlin Li
renlin.li@arm.com
Tue Sep 15 13:12:00 GMT 2015
Hi all,
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.
For example, the following code:
.text
test:
.word 0xeeff
bl __tls_get_addr
nop
.word 0xffee
After assemble, link, the objdump, the code is:
0000000000000280 <__tls_get_addr@plt-0x20>:
280: a9bf7bf0 stp x16, x30, [sp,#-16]!
284: 90000090 adrp x16, 10000 <test+0xfd50>
288: f941e611 ldr x17, [x16,#968]
28c: 910f2210 add x16, x16, #0x3c8
290: d61f0220 br x17
294: d503201f nop
298: d503201f nop
29c: d503201f nop
00000000000002a0 <__tls_get_addr@plt>:
2a0: 90000090 adrp x16, 10000 <test+0xfd50>
2a4: f941ea11 ldr x17, [x16,#976]
2a8: 910f4210 add x16, x16, #0x3d0
2ac: d61f0220 br x17
Disassembly of section .text:
00000000000002b0 <test>:
2b0: 0000eeff .inst 0x0000eeff ; undefined
2b4: 97fffffb bl 2a0 <__tls_get_addr@plt>
2b8: d503201f nop
2bc: 0000ffee .inst 0x0000ffee ; undefined
As only elf target is implement in aarch64, this also makes the check
redundant here.
binutils regression test Okay, is it fine to commit?
opcodes/ChangeLog:
2015-09-15 Renlin Li <renlin.li@arm.com>
* aarch64-dis.c (print_insn_aarch64): Drop symbol flavour check.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flavour.diff
Type: text/x-patch
Size: 538 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150915/9e2b70e9/attachment.bin>
More information about the Binutils
mailing list