This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix irix6o32 explicit-reloc breakage
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: echristo at redhat dot com
- Date: 18 May 2003 19:29:25 +0100
- Subject: Patch to fix irix6o32 explicit-reloc breakage
As Alex reported a couple of weeks ago, the irix6o32 configuration
was using explicit relocs by default, even though the native o32
assembler doesn't support them. This was an oversight in my
configure patch, sorry. It was checking the n32 assembler
rather than the o32 one.
At first I wondered about changing the configure test, but in
the end it seemed better to catch this case in override_options()
instead. I think gas is the only o32 assembler to support %got(),
so it seems reasonable to assume that
!TARGET_GAS && !TARGET_NEWABI => !TARGET_EXPLICIT_RELOCS
The user can still override this with -mexplicit-relocs if necessary.
Tested on mips-sgi-irix6o32 (and other mips targets).
The target now bootstraps with the native assembler,
although I needed a couple of changes to irix6-o32-as.h
to get things working. OK to install?
Richard
* config/mips/mips.c (override_options): Disable explicit
relocs for old ABIs unless using gas.
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.263
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.263 mips.c
*** config/mips/mips.c 14 May 2003 07:29:50 -0000 1.263
--- config/mips/mips.c 18 May 2003 17:29:27 -0000
*************** override_options ()
*** 5681,5686 ****
--- 5452,5464 ----
target_flags &= ~MASK_EXPLICIT_RELOCS;
}
+ /* Explicit relocations for "old" ABIs are a GNU extension. Unless
+ the user has said otherwise, assume that they are not available
+ with assemblers other than gas. */
+ if (!TARGET_NEWABI && !TARGET_GAS
+ && (target_flags_explicit & MASK_EXPLICIT_RELOCS) == 0)
+ target_flags &= ~MASK_EXPLICIT_RELOCS;
+
/* -mrnames says to use the MIPS software convention for register
names instead of the hardware names (ie, $a0 instead of $4).
We do this by switching the names in mips_reg_names, which the