This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

PATCH 3.1: Fix mips.c for Irix bootstrap.


A patch introduced by Eric Christopher broke mips-sgi-irix6.5
bootstrap.  This patch, written by him, fixes the problem, but he is
away so I am committing the patch.  Richard Henderson critiqued the
patch:

    This [patch] is ok, though in general it's a lousy way to identify an abi.

Tue Sep 18 09:51:11 2001  Eric Christopher  <ecechristo@redhat.com>

        * config/mips/mips.c (mips_asm_file_start): Conditionalize Elf
        code generation only for Gnu assembler.

Tested on       mips-sgi-irix6.5
                  gcc.c-torture/compile/20001226-1.c, -O3 -g regressed
                  but this just indicates that the compilation time
                  increased by a few seconds.  On good days, this test
                  case takes very close to the 300second limit so
                  minor compiler changes can cause the test to fail or
                  not fail.
Approved by     Richard Henderson (rth@redhat.com)
Applied to      mainline

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.151
diff -c -p -r1.151 mips.c
*** mips.c	2001/09/15 02:03:13	1.151
--- mips.c	2001/09/18 15:49:07
*************** mips_asm_file_start (stream)
*** 6104,6135 ****
    if (TARGET_MIPS_AS && optimize && flag_delayed_branch)
      fprintf (stream, "\t.set\tnobopt\n");
  
! #ifdef OBJECT_FORMAT_ELF
!   /* Generate a special section to describe the ABI switches used to produce
!      the resultant binary.  This used to be done by the assembler setting bits
!      in the ELF header's flags field, but we have run out of bits.  GDB needs
!      this information in order to be able to correctly debug these binaries.
!      See the function mips_gdbarch_init() in gdb/mips-tdep.c.  */
!   switch (mips_abi)
      {
!     case ABI_32:   abi_string = "abi32"; break;
!     case ABI_N32:  abi_string = "abiN32"; break;
!     case ABI_64:   abi_string = "abi64"; break;
!     case ABI_O64:  abi_string = "abiO64"; break;
!     case ABI_EABI: abi_string = TARGET_64BIT ? "eabi64" : "eabi32"; break;
!     case ABI_MEABI:abi_string = TARGET_64BIT ? "meabi64" : "meabi32"; break;
!     default:
!       abort ();
!     }
!   /* Note - we use fprintf directly rather than called named_section()
!      because in this way we can avoid creating an allocated section.  We
!      do not want this section to take up any space in the running
!      executable.  */
!   fprintf (stream, "\t.section .mdebug.%s\n", abi_string);
  
!   /* Restore the default section.  */
!   fprintf (stream, "\t.previous\n");
  #endif
  
  
  
--- 6104,6140 ----
    if (TARGET_MIPS_AS && optimize && flag_delayed_branch)
      fprintf (stream, "\t.set\tnobopt\n");
  
!   if (TARGET_GAS)
      {
! #if defined(OBJECT_FORMAT_ELF)
!       /* Generate a special section to describe the ABI switches used to
! 	 produce the resultant binary.  This used to be done by the assembler
! 	 setting bits in the ELF header's flags field, but we have run out of
! 	 bits.  GDB needs this information in order to be able to correctly
! 	 debug these binaries. See the function mips_gdbarch_init() in
! 	 gdb/mips-tdep.c.  */
! 
!       switch (mips_abi)
! 	{
! 	case ABI_32:   abi_string = "abi32"; break;
! 	case ABI_N32:  abi_string = "abiN32"; break;
! 	case ABI_64:   abi_string = "abi64"; break;
! 	case ABI_O64:  abi_string = "abiO64"; break;
! 	case ABI_EABI: abi_string = TARGET_64BIT ? "eabi64" : "eabi32"; break;
! 	case ABI_MEABI:abi_string = TARGET_64BIT ? "meabi64" : "meabi32"; break;
! 	default:
! 	  abort ();
! 	}
!       /* Note - we use fprintf directly rather than called named_section()
! 	 because in this way we can avoid creating an allocated section.  We
! 	 do not want this section to take up any space in the running
! 	 executable.  */
!       fprintf (stream, "\t.section .mdebug.%s\n", abi_string);
  
!       /* Restore the default section.  */
!       fprintf (stream, "\t.previous\n");
  #endif
+     }

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