This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patches to support traditional mips target (mips-dde-sysv4.2MP).


Here is the patch for binutils-000428/gas/config/tc-mips.c. This patch also 
handles a problem with gas while handling weak symbols. 


Index: tc-mips.c
===================================================================
RCS file: /gnu/cvsroot/binutils-000428/gas/config/tc-mips.c,v
retrieving revision 1.1.1.1
diff -u -p -b -r1.1.1.1 tc-mips.c
--- tc-mips.c	2000/04/29 05:25:08	1.1.1.1
+++ tc-mips.c	2000/04/29 07:54:31
@@ -121,9 +121,15 @@ mips_target_format ()
     case bfd_target_coff_flavour:
       return "pe-mips";
     case bfd_target_elf_flavour:
+#ifdef TE_TMIPS
+      /* This is traditional mips */
       return (target_big_endian
+              ? "elf32-tradbigmips" : "elf32-tradlittlemips");
+#else
+      return (target_big_endian
 	      ? (mips_64 ? "elf64-bigmips" : "elf32-bigmips")
 	      : (mips_64 ? "elf64-littlemips" : "elf32-littlemips"));
+#endif
     default:
       abort ();
       return NULL;
@@ -10976,7 +10982,10 @@ md_estimate_size_before_relax (fragp, se
      asection *segtype;
 {
   int change;
+  boolean linkonce;
 
+  linkonce = false;
+
   if (RELAX_MIPS16_P (fragp->fr_subtype))
     {
       if (mips16_extended_frag (fragp, segtype, 0))
@@ -11018,10 +11027,28 @@ md_estimate_size_before_relax (fragp, se
 
       symsec = S_GET_SEGMENT (sym);
 
+      /* duplicate the test for LINK_ONCE sections as in adjust_reloc_syms */
+      if (symsec != segtype && ! S_IS_LOCAL (sym))
+        {
+          if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE)
+              != 0)
+            linkonce = true;
+
+          /* The GNU toolchain uses an extension for ELF: a section
+             beginning with the magic string .gnu.linkonce is a linkonce
+             section.  */
+          if (strncmp (segment_name (symsec), ".gnu.linkonce",
+                       sizeof ".gnu.linkonce" - 1) == 0)
+            linkonce = true;
+        }
+      /* This must duplicate the test in adjust_reloc_syms.  */
+
       /* This must duplicate the test in adjust_reloc_syms.  */
       change = (symsec != &bfd_und_section
 		&& symsec != &bfd_abs_section
-		&& ! bfd_is_com_section (symsec));
+		&& ! bfd_is_com_section (symsec)
+                && !S_IS_WEAK (sym)
+                && !linkonce);
     }
   else
     abort ();

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]