]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
binutils: generalize init_dwarf_regnames_by_* functions
authorJose E. Marchesi <jose.marchesi@oracle.com>
Sat, 12 Jul 2025 08:54:46 +0000 (10:54 +0200)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Sat, 12 Jul 2025 09:33:25 +0000 (11:33 +0200)
This patch renames the functions:

  init_dwarf_regnames_by_elf_machine_code
  init_dwarf_regnames_by_bfd_arch_and_mach

to

  init_dwarf_by_elf_machine_code
  init_dwarf_by_bfd_arch_and_mach

The idea is to start using these functions to perform general
architecture/machine specific initializations beyond register names.

Regtested in x86_64-linux-gnu and aarch64-linux-gnu targets.

binutils/ChangeLog:

* dwarf.c (init_dwarf_regnames_by_elf_machine_code): Rename to
init_dwarf_by_elf_machine_code.
(init_dwarf_regnames_by_bfd_arch_and_mach): Rename to
init_dwarf_by_bfd_arch_and_mach.
* dwarf.h: Adjust prototypes accordingly.
* readelf.c (process_file_header): Adjust call to
init_dwarf_regnames_by_elf_machine_code accordingly.
* objdump.c (dump_dwarf): Adjust call to
init_dwarf_regnames_by_bfd_arch_and_mach accordingly.

binutils/dwarf.c
binutils/dwarf.h
binutils/objdump.c
binutils/readelf.c

index e0e202fd6837428b4248f00a2f5ad90b52d9d14d..89594b5f5f2887beda7739a05dde0507ca070b5f 100644 (file)
@@ -8895,7 +8895,7 @@ init_dwarf_regnames_loongarch (void)
 }
 
 void
-init_dwarf_regnames_by_elf_machine_code (unsigned int e_machine)
+init_dwarf_by_elf_machine_code (unsigned int e_machine)
 {
   dwarf_regnames_lookup_func = NULL;
   is_aarch64 = false;
@@ -8941,8 +8941,8 @@ init_dwarf_regnames_by_elf_machine_code (unsigned int e_machine)
    architecture and specific machine type of a BFD.  */
 
 void
-init_dwarf_regnames_by_bfd_arch_and_mach (enum bfd_architecture arch,
-                                         unsigned long mach)
+init_dwarf_by_bfd_arch_and_mach (enum bfd_architecture arch,
+                                unsigned long mach)
 {
   dwarf_regnames_lookup_func = NULL;
   is_aarch64 = false;
index 6f693b1eac2a73abb0bf6bc72552af25594d5bab..13afb4a0da37f9049b157e4ae90766676e24113a 100644 (file)
@@ -241,9 +241,9 @@ extern unsigned long dwarf_start_die;
 
 extern int dwarf_check;
 
-extern void init_dwarf_regnames_by_elf_machine_code (unsigned int);
-extern void init_dwarf_regnames_by_bfd_arch_and_mach (enum bfd_architecture arch,
-                                                     unsigned long mach);
+extern void init_dwarf_by_elf_machine_code (unsigned int);
+extern void init_dwarf_by_bfd_arch_and_mach (enum bfd_architecture arch,
+                                            unsigned long mach);
 
 extern bool load_debug_section (enum dwarf_section_display_enum, void *);
 extern void free_debug_section (enum dwarf_section_display_enum);
index 7bb6d766ba2c216b0e8b0491fc05ffd9fa4b28a0..98d30496a6f2532eb8a63db0d1da4352e24a185a 100644 (file)
@@ -4551,8 +4551,8 @@ dump_dwarf (bfd *abfd, bool is_mainfile)
       break;
     }
 
-  init_dwarf_regnames_by_bfd_arch_and_mach (bfd_get_arch (abfd),
-                                           bfd_get_mach (abfd));
+  init_dwarf_by_bfd_arch_and_mach (bfd_get_arch (abfd),
+                                  bfd_get_mach (abfd));
 
   bfd_map_over_sections (abfd, dump_dwarf_section, (void *) &is_mainfile);
 }
index 87615d95ac12052eedf0cff0ee588cf2536e645b..4a3307eaec616658338803245ddce4c82fe6417d 100644 (file)
@@ -6828,7 +6828,7 @@ process_file_header (Filedata * filedata)
     return false;
 
   if (! filedata->is_separate)
-    init_dwarf_regnames_by_elf_machine_code (header->e_machine);
+    init_dwarf_by_elf_machine_code (header->e_machine);
 
   if (do_header)
     {