This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Move mips port to in_small_data_p
This patch seems to do the right thing under cross compilation.
I'll run it through an irix6o32 bootstrap.
Only the mips_select_section change is needed to fix the bug.
The change to override_options prevents an abort when using
command lines such as:
mips-sgi-irix5-gcc -mgas -mno-abicalls -G8 ...
Richard
* 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.
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.294
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.294 mips.c
--- config/mips/mips.c 15 Jul 2003 08:44:25 -0000 1.294
+++ config/mips/mips.c 30 Jul 2003 21:37:46 -0000
@@ -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);
}