This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Patches to support traditional mips target (mips-dde-sysv4.2MP).
- To: binutils at sourceware dot cygnus dot com
- Subject: Patches to support traditional mips target (mips-dde-sysv4.2MP).
- From: "Koundinya.K" <kk at ddeorg dot soft dot net>
- Date: Wed, 03 May 2000 16:54:23 +0530
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 ();