[PATCH] Change idt64.ld to also accept MIPS32r2 objects

Adam Nemet anemet@caviumnetworks.com
Tue Dec 2 06:40:00 GMT 2008


When testing GCC with the mips-sim-idt64 board, the -mips32r2 multilib from
the mips64r2-elfoabi configuration fails to link.  (Note that this is not an
r2-only issue, mips64-elfoabi would fail similarly.)

idt64.ld sets OUTPUT_ARCH to isa64 which neither extends nor is a subset of
isa32r2.  To fix this, the patch below changes OUTPUT_ARCH to isa64r2.  I also
extended the comment to explain why setting the ISA in OUTPUT_ARCH is
necessary.

With this I was able to test -mips32r2 on mips-sim-idt64.  Also GCC
testresults are identical for mipsisa64r2-elfoabi with the default multilib
before and after.

OK to install?  Should I also change idt32.ld to isa32r2 for consistency?

Adam

	* mips/idt64.ld: Set arch to mips:isa64r2 from mips:isa64.  Update
	comment.

Index: idt64.ld
===================================================================
RCS file: /cvs/src/src/libgloss/mips/idt64.ld,v
retrieving revision 1.9
diff -u -r1.9 idt64.ld
--- idt64.ld	8 Jun 2006 16:13:11 -0000	1.9
+++ idt64.ld	2 Dec 2008 06:27:58 -0000
@@ -1,9 +1,11 @@
 /* The following TEXT start address leaves space for the monitor
-   workspace.  This linker script links isa32 programs for use with the
-   simulator.  */
+   workspace.  This linker script links ISA64r2 programs for use with the
+   simulator.  We set the ISA explicitly so that we can link objects of
+   different ISAs that are subsets of ISA64r2 but are not extensions of
+   each other (e.g., MIPS32r2 and MIPS64).  */
 
 ENTRY(_start)
-OUTPUT_ARCH("mips:isa64")
+OUTPUT_ARCH("mips:isa64r2")
 OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips", "elf32-littlemips")
 GROUP(-lc -lidt -lgcc)
 SEARCH_DIR(.)



More information about the Binutils mailing list