binutils: Make DWARF register name lookup be via a function pointer
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 18 Nov 2019 15:28:20 +0000 (15:28 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 28 Nov 2019 00:03:04 +0000 (00:03 +0000)
commit1296bc99b1bf5da38be18ac1fdf6ad8d1b697e6b
tree5f810f6208df89370c4de3119ca77f9fc4584601
parent99f6fdd9eb60f5b8b9b172b1b2cfa627be566a9d
binutils: Make DWARF register name lookup be via a function pointer

Add a layer of indirection for DWARF register name lookup by
introducing a function pointer.  Right now all targets use the same
table based implementation that they always have, however, this will
change in a later commit.

binutils/ChangeLog:

* dwarf.c (typedef dwarf_regname_lookup_ftype): New typedef.
(dwarf_regnames_lookup_func): New static global.
(init_dwarf_regnames_i386): Set dwarf_regnames_lookup_func.
(init_dwarf_regnames_iamcu): Likewise.
(init_dwarf_regnames_x86_64): Likewise.
(init_dwarf_regnames_aarch64): Likewise.
(init_dwarf_regnames_s390): Likewise.
(init_dwarf_regnames_riscv): Likewise.
(init_dwarf_regnames_by_elf_machine_code): Reset
dwarf_regnames_lookup_func to NULL.
(init_dwarf_regnames_by_bfd_arch_and_mach): Likewise.
(regname_internal_by_table_only): New function.
(regname): Make use of dwarf_regnames_lookup_func.

Change-Id: Ibbff61c0abea32927f35c9e478793039ab8bb57d
binutils/ChangeLog
binutils/dwarf.c