This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Default 64-bit ELF MIPS binaries to N64


GCC generally emits tags in MIPS binaries to identify the ABI in use. 
There's also various ELF tags.  However, it's possible to get an untagged
binary, and if we do, GDB currently defaults to O32.  That's a pretty
silly choice - O32 will never be encapsulated in a 64-bit ELF file with
64-bit symbol addresses.  So pick a more sensible default.

Tested and committed.

-- 
Daniel Jacobowitz
CodeSourcery

2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* mips-tdep.c (mips_gdbarch_init): Default 64-bit ELF files to N64.

Index: src/gdb/mips-tdep.c
===================================================================
--- src.orig/gdb/mips-tdep.c	2006-03-15 10:24:12.000000000 -0500
+++ src/gdb/mips-tdep.c	2006-03-15 10:24:12.000000000 -0500
@@ -4764,6 +4764,13 @@ mips_gdbarch_init (struct gdbarch_info i
 	}
     }
 
+  /* Default 64-bit objects to N64 instead of O32.  */
+  if (found_abi == MIPS_ABI_UNKNOWN
+      && info.abfd != NULL
+      && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
+      && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS64)
+    found_abi = MIPS_ABI_N64;
+
   if (gdbarch_debug)
     fprintf_unfiltered (gdb_stdlog, "mips_gdbarch_init: found_abi = %d\n",
 			found_abi);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]