]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mips.c (override_options): Disable -G on targets that have no .section support.
authorRichard Sandiford <rsandifo@redhat.com>
Mon, 4 Aug 2003 20:23:15 +0000 (20:23 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 4 Aug 2003 20:23:15 +0000 (20:23 +0000)
* config/mips/mips.c (override_options): Disable -G on targets that
have no .section support.
(mips_select_section): Use default_select_section for such targets.

From-SVN: r70154

gcc/ChangeLog
gcc/config/mips/mips.c

index 583b6fcc9138f2dd51b1498ad395368ebbdc9457..ee5f70b97b25feb405ad1b17b76445b50b5beb74 100644 (file)
@@ -1,3 +1,9 @@
+2003-08-04  Richard Sandiford  <rsandif@redhat.com>
+
+       * config/mips/mips.c (override_options): Disable -G on targets that
+       have no .section support.
+       (mips_select_section): Use default_select_section for such targets.
+
 2003-08-04  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * fixinc/inclhack.def (svr4_undeclared_getrnge): Introduce and enable.
index 122e44bd1429a33f3fd8239a7a29fe528e23c00a..9fe8bbf912ce05ea61a688089c7eb53253cc97cd 100644 (file)
@@ -5059,6 +5059,13 @@ override_options ()
   if (!TARGET_EXPLICIT_RELOCS && !TARGET_GAS)
     mips_section_threshold = 0;
 
+  /* We switch to small data sections using ".section", which the native
+     o32 irix assemblers don't understand.  Disable -G accordingly.
+     We must do this regardless of command-line options since otherwise
+     the compiler would abort.  */
+  if (!targetm.have_named_sections)
+    mips_section_threshold = 0;
+
   /* -membedded-pic is a form of PIC code suitable for embedded
      systems.  All calls are made using PC relative addressing, and
      all data is addressed using the $gp register.  This requires gas,
@@ -7879,8 +7886,11 @@ mips_select_section (decl, reloc, align)
        For mips16 code, put strings in the text section so that a PC
        relative load instruction can be used to get their address.  */
     text_section ();
-  else
+  else if (targetm.have_named_sections)
     default_elf_select_section (decl, reloc, align);
+  else
+    /* The native irix o32 assembler doesn't support named sections.  */
+    default_select_section (decl, reloc, align);
 }