public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Patches for IRIX6 N32-ABI ld
@ 1999-07-01  0:00 Mark Mitchell
  1999-07-01  0:00 ` Richard Henderson
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Mitchell @ 1999-07-01  0:00 UTC (permalink / raw)
  To: binutils

I'm going to begin submitting the patches required to support the N32
ABI on IRIX6.  Although these have been tested heavily on IRIX6 (a
complete EGCS build and regression test-run), they have not been
tested no any other MIPS platform.  Therefore, it is possible
(likely?) that I have broken something elsewhere.  I hope that people
will test these patches, and report problems; I will, of course,
attempt to fix them as quickly as possible.

I'm going to try to keep the individual patches as simple as possible,
and do the easiest ones first.  That way, we can look at each change
and make sure it makes sense, and avoid getting bogged down.

This first one is very simple.  OK to check in?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-06-26  Mark Mitchell  <mark@codesourcery.com>

	* elf32-mips.c (sgi_compat_t): New enumeration.
	(ABI_N32_P): New macro.
	(SGI_COMPAT): Return what kind of compatibility is being 
	provided.
	(mips_elf_relocate_section): Fix typo.

Index: elf32-mips.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-mips.c,v
retrieving revision 1.5
diff -u -p -r1.5 elf32-mips.c
--- elf32-mips.c	1999/06/12 13:08:29	1.5
+++ elf32-mips.c	1999/06/26 17:53:13
@@ -125,12 +125,26 @@ static bfd_byte *elf32_mips_get_relocate
   PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
 	   bfd_byte *, boolean, asymbol **));
 
-/* This is true for Irix 5 executables, false for normal MIPS ELF ABI
-   executables.  FIXME: At the moment, we default to always generating
-   Irix 5 executables.  */
+/* The kind of SGI compatibility we're striving for.  */
 
-#define SGI_COMPAT(abfd) (1)
+typedef enum {
+  sct_none,
+  sct_irix5,
+  sct_irix6
+} sgi_compat_t;
 
+/* Nonzero if ABFD is using the N32 ABI.  */
+
+#define ABI_N32_P(abfd) \
+  ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
+
+/* What version of Irix we are trying to be compatible with.  FIXME:
+   At the moment, we never generate "normal" MIPS ELF ABI executables;
+   we always use some version of Irix.  */
+
+#define SGI_COMPAT(abfd) \
+  (ABI_N32_P (abfd) ? sct_irix6 : sct_irix5)
+
 /* This structure is used to hold .got information when linking.  It
    is stored in the tdata field of the bfd_elf_section_data structure.  */
 
@@ -5638,7 +5652,7 @@ mips_elf_relocate_section (output_bfd, i
 	      && (r == bfd_reloc_undefined || r == bfd_reloc_overflow))
 	    r = bfd_reloc_ok;
 
-	  if (SGI_COMPAT (abfd)
+	  if (SGI_COMPAT (output_bfd)
 	      && scpt != NULL
 	      && (input_section->flags & SEC_ALLOC) != 0)
 	    {

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1999-07-01  0:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-01  0:00 Patches for IRIX6 N32-ABI ld Mark Mitchell
1999-07-01  0:00 ` Richard Henderson
1999-07-01  0:00   ` Mark Mitchell
1999-07-01  0:00     ` Ian Lance Taylor
1999-07-01  0:00       ` Mark Mitchell
1999-07-01  0:00         ` Ian Lance Taylor
1999-07-01  0:00           ` Mark Mitchell
1999-07-01  0:00             ` Ian Lance Taylor
1999-07-01  0:00               ` Mark Mitchell
1999-07-01  0:00             ` Richard Henderson
1999-07-01  0:00               ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).