[binutils-gdb] binutils: generalize init_dwarf_regnames_by_* functions

Jose E. Marchesi jemarch@sourceware.org
Sat Jul 12 09:37:29 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3e97860c29ae2aee5644fd10cf868d2f1f5c9703

commit 3e97860c29ae2aee5644fd10cf868d2f1f5c9703
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Sat Jul 12 10:54:46 2025 +0200

    binutils: generalize init_dwarf_regnames_by_* functions
    
    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.

Diff:
---
 binutils/dwarf.c   | 6 +++---
 binutils/dwarf.h   | 6 +++---
 binutils/objdump.c | 4 ++--
 binutils/readelf.c | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index e0e202fd683..89594b5f5f2 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -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;
diff --git a/binutils/dwarf.h b/binutils/dwarf.h
index 6f693b1eac2..13afb4a0da3 100644
--- a/binutils/dwarf.h
+++ b/binutils/dwarf.h
@@ -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);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 7bb6d766ba2..98d30496a6f 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -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);
 }
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 87615d95ac1..4a3307eaec6 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -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)
     {


More information about the Binutils-cvs mailing list