This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: [patch, binutils] Patch elf/mips.h for -mfp64 support.


On 09/11/2013 10:39 AM, Richard Sandiford wrote:
> "Maciej W. Rozycki" <macro@codesourcery.com> writes:
>> ...
>> code.  So just as we don't call the former flag EF_MIPS_GP64_32BITMODE or 
>> whatever we don't have to call the new flag EF_MIPS_32BITMODE_FP64 either.
> 
> Yeah, good point.  EF_MIPS_GP32_FP64 might avoid that confusion while
> still being more precise than EF_MIPS_FP64.
> ...

I attached the update patch.

Is it OK if Steve Ellcey commits this change for me?

Thanks,

Doug

ChangeLog updates:

include/elf/ChangeLog:
        * mips.h (EF_MIPS_32BITMODE): New e_flags bit.

bfd/ChangeLog:
        * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Handle
        EF_MIPS_32BITMODE.

binutils/ChangeLog:
        * readelf.c (get_machine_flags): Handle EF_MIPS_32BITMODE.

gas/ChangeLog:
        * config/tc-mips.c (mips_elf_final_processing): Set
        EF_MIPS_32BITMODE for -mgp32 -mfp64, removing old FIXME.

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.358
diff -u -p -r1.358 elfxx-mips.c
--- bfd/elfxx-mips.c	15 Jul 2013 15:07:29 -0000	1.358
+++ bfd/elfxx-mips.c	17 Sep 2013 00:02:35 -0000
@@ -14938,6 +14938,9 @@ _bfd_mips_elf_print_private_bfd_data (bf
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_NAN2008)
     fprintf (file, " [nan2008]");
 
+  if (elf_elfheader (abfd)->e_flags & EF_MIPS_FP64)
+    fprintf (file, " [fp64]");
+
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE)
     fprintf (file, " [32bitmode]");
   else
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.607
diff -u -p -r1.607 readelf.c
--- binutils/readelf.c	9 Aug 2013 10:40:03 -0000	1.607
+++ binutils/readelf.c	17 Sep 2013 00:02:35 -0000
@@ -2571,6 +2571,9 @@ get_machine_flags (unsigned e_flags, uns
 	  if (e_flags & EF_MIPS_NAN2008)
 	    strcat (buf, ", nan2008");
 
+	  if (e_flags & EF_MIPS_FP64)
+	    strcat (buf, ", fp64");
+
 	  switch ((e_flags & EF_MIPS_MACH))
 	    {
 	    case E_MIPS_MACH_3900: strcat (buf, ", 3900"); break;
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.592
diff -u -p -r1.592 tc-mips.c
--- gas/config/tc-mips.c	12 Sep 2013 21:41:09 -0000	1.592
+++ gas/config/tc-mips.c	17 Sep 2013 00:02:39 -0000
@@ -17211,11 +17211,9 @@ mips_elf_final_processing (void)
   if (mips_flag_nan2008)
     elf_elfheader (stdoutput)->e_flags |= EF_MIPS_NAN2008;
 
-#if 0 /* XXX FIXME */
   /* 32 bit code with 64 bit FP registers.  */
   if (!file_mips_fp32 && ABI_NEEDS_32BIT_REGS (mips_abi))
-    elf_elfheader (stdoutput)->e_flags |= ???;
-#endif
+    elf_elfheader (stdoutput)->e_flags |= EF_MIPS_FP64;
 }
 
 typedef struct proc {
Index: include/elf/mips.h
===================================================================
RCS file: /cvs/src/src/include/elf/mips.h,v
retrieving revision 1.54
diff -u -p -r1.54 mips.h
--- include/elf/mips.h	15 Jul 2013 15:07:30 -0000	1.54
+++ include/elf/mips.h	17 Sep 2013 00:02:39 -0000
@@ -191,6 +191,9 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
    (regs are 32-bits wide).  */
 #define EF_MIPS_32BITMODE	0x00000100
 
+/* 32-bit machine but FP registers are 64 bit (-mfp64).  */
+#define EF_MIPS_FP64		0x00000200
+
 /* Code in file uses the IEEE 754-2008 NaN encoding convention.  */
 #define EF_MIPS_NAN2008		0x00000400
 



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