* dwarf.c (init_dwarf_regnames_i386, init_dwarf_regnames_x86_64): New.

(init_dwarf_regnames): Use them.
	* dwarf.h: Declare them.
	* objdump.c (dump_dwarf): Use bfd_get_arch + bfd_get_mach to set up
	the regnames, rather than using elf_machine_code.
This commit is contained in:
Richard Henderson
2010-09-02 22:35:18 +00:00
parent 09fc85f6cf
commit b129eb0e56
4 changed files with 44 additions and 8 deletions

View File

@@ -3961,6 +3961,13 @@ static const char *const dwarf_regnames_i386[] =
"tr", "ldtr"
};
void
init_dwarf_regnames_i386 (void)
{
dwarf_regnames = dwarf_regnames_i386;
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_i386);
}
static const char *const dwarf_regnames_x86_64[] =
{
"rax", "rdx", "rcx", "rbx",
@@ -3983,6 +3990,13 @@ static const char *const dwarf_regnames_x86_64[] =
"mxcsr", "fcw", "fsw"
};
void
init_dwarf_regnames_x86_64 (void)
{
dwarf_regnames = dwarf_regnames_x86_64;
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
}
void
init_dwarf_regnames (unsigned int e_machine)
{
@@ -3990,14 +4004,12 @@ init_dwarf_regnames (unsigned int e_machine)
{
case EM_386:
case EM_486:
dwarf_regnames = dwarf_regnames_i386;
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_i386);
init_dwarf_regnames_i386 ();
break;
case EM_X86_64:
case EM_L1OM:
dwarf_regnames = dwarf_regnames_x86_64;
dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
init_dwarf_regnames_x86_64 ();
break;
default: