aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-08-22 15:16:56 +0000
committerDaniel Jacobowitz <drow@false.org>2007-08-22 15:16:56 +0000
commit609ca2b95777ae176d12721010225ad7aad86321 (patch)
tree104f880cae0609e89121951f835be2a8b3a9ee88 /gdb
parent8d26208a1e22d9720c1423625c7e15f1bc7d237c (diff)
downloadfsf-binutils-gdb-609ca2b95777ae176d12721010225ad7aad86321.zip
fsf-binutils-gdb-609ca2b95777ae176d12721010225ad7aad86321.tar.gz
fsf-binutils-gdb-609ca2b95777ae176d12721010225ad7aad86321.tar.bz2
* mips-tdep.c (mips_gdbarch_init): Use Tag_GNU_MIPS_ABI_FP to
determine the file's FPU type.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mips-tdep.c25
2 files changed, 30 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cde1d09..f1edff4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2007-08-22 Daniel Jacobowitz <dan@codesourcery.com>
+ * mips-tdep.c (mips_gdbarch_init): Use Tag_GNU_MIPS_ABI_FP to
+ determine the file's FPU type.
+
+2007-08-22 Daniel Jacobowitz <dan@codesourcery.com>
+
* mips-tdep.c (mips_n32n64_fp_arg_chunk_p): New.
(mips_n32n64_push_dummy_call): Always increment float_argreg along
with argreg. Use mips_n32n64_fp_arg_chunk_p.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 68621e1..654ef13 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -4913,6 +4913,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
int i, num_regs;
enum mips_fpu_type fpu_type;
struct tdesc_arch_data *tdesc_data = NULL;
+ int elf_fpu_type = 0;
/* Check any target description for validity. */
if (tdesc_has_registers (info.target_desc))
@@ -5120,8 +5121,32 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
mips64_transfers_32bit_regs_p);
/* Determine the MIPS FPU type. */
+#ifdef HAVE_ELF
+ if (info.abfd
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
+ elf_fpu_type = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU,
+ Tag_GNU_MIPS_ABI_FP);
+#endif /* HAVE_ELF */
+
if (!mips_fpu_type_auto)
fpu_type = mips_fpu_type;
+ else if (elf_fpu_type != 0)
+ {
+ switch (elf_fpu_type)
+ {
+ case 1:
+ fpu_type = MIPS_FPU_DOUBLE;
+ break;
+ case 2:
+ fpu_type = MIPS_FPU_SINGLE;
+ break;
+ case 3:
+ default:
+ /* Soft float or unknown. */
+ fpu_type = MIPS_FPU_NONE;
+ break;
+ }
+ }
else if (info.bfd_arch_info != NULL
&& info.bfd_arch_info->arch == bfd_arch_mips)
switch (info.bfd_arch_info->mach)