[PATCH V4 1/8] binutils: generalize init_dwarf_regnames_by_* functions
Jose E. Marchesi
jose.marchesi@oracle.com
Wed Jul 9 21:44:49 GMT 2025
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 | 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 573024727f2..bcaac571e73 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -6827,7 +6827,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)
{
--
2.30.2
More information about the Binutils
mailing list