public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: Don Bowman <don@pixsci.com>
To: "'gas2@cygnus.com'" <gas2@cygnus.com>
Subject: Patch for binutils (GAS-980329) for VxWorks on MIPS
Date: Sun, 29 Mar 1998 15:46:00 -0000	[thread overview]
Message-ID: <3521B963898BD111AA6A006008A84516079B37@SERVER> (raw)

Under VxWorks 5.3.1 [The Tornado 1.0.1 release] for the MIPS targets,
gas cannot create a debuggable image. This occurs since the Tornado
target server requires a separate .stab & .stabstr section. It cannot
deal with the .mdebug ecoff section. 
The fix is to three main areas:
1: configure: accept 'mips-wrs-vxworks' as a valid configuration target
2: obj-elf.h: allow output to separate sections. The comment that was
   there indicated this had been removed due to an Irix 6 limitation. This
   may not affect any of the other ELF targets, but I cannot say for
certain:
   it certainly does not affect the VxWorks MIPS platform.
3: A fix to ecoff.c: the comment about input_line_pointer pointing to the
   beginning of the stab value appears incorrect.

This patch is against GAS-980329

The Changelog entries would be something like:

bfd:
Sun Mar 29 18:32:00 1998 Don Bowman <don@pixsci.com>

        * config.bfd: add mips*el-wrs-vxworks and mips*-wrs-vxworks

gas:
Sun Mar 29 18:32:00 1998 Don Bowman <don@pixsci.com>

        * configure: add mips*el-wrs-vxworks and mips*-wrs-vxworks
        * configure.in: add mips*el-wrs-vxworks and mips*-wrs-vxworks
        * obj-elf.h: allow separate stab sections and non-ecoff debugging
for MIPS
        * ecoff.c (ecoff_stab): remove erroneous check for valid start of
stab
        identifier

The following patch was generated by running:

$ diff -up -r gas-980329 gas-980329.modified
-----------START OF PATCH------------
diff -r -up gas-980329/bfd/config.bfd gas-980329.modified/bfd/config.bfd
--- gas-980329/bfd/config.bfd	Sun Mar 29 04:18:24 1998
+++ gas-980329.modified/bfd/config.bfd	Sun Mar 29 14:21:33 1998
@@ -423,11 +423,11 @@ case "${targ}" in
     targ_defvec=ecoff_big_vec
     targ_selvecs=ecoff_little_vec
     ;;
-  mips*el-*-elf*)
+  mips*el-*-elf* | mips*el-wrs-vxworks)
     targ_defvec=bfd_elf32_littlemips_vec
     targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec
bfd_elf64_littlemips_vec"
     ;;
-  mips*-*-elf* | mips*-*-rtems*)
+  mips*-*-elf* | mips*-*-rtems* | mips*-wrs-vxworks)
     targ_defvec=bfd_elf32_bigmips_vec
     targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec
bfd_elf64_littlemips_vec"
     ;;
diff -r -up gas-980329/gas/config/obj-elf.h
gas-980329.modified/gas/config/obj-elf.h
--- gas-980329/gas/config/obj-elf.h	Sun Mar 29 04:10:25 1998
+++ gas-980329.modified/gas/config/obj-elf.h	Sun Mar 29 16:55:17 1998
@@ -141,12 +141,18 @@ extern void obj_elf_init_stab_section PA
 #define ECOFF_DEBUGGING 1
 #endif
 
+
+#define MIPS_STABS_ELF 1
 /* For now, always set ECOFF_DEBUGGING for a MIPS target.  */
 #ifdef TC_MIPS
+#ifdef MIPS_STABS_ELF
+#define ECOFF_DEBUGGING 0
+#else
 #define ECOFF_DEBUGGING 1
-#endif
+#endif /* MIPS_STABS_ELF */
+#endif /* TC_MIPS */
 
-#if ECOFF_DEBUGGING
+#if (ECOFF_DEBUGGING == 1) || (MIPS_STABS_ELF == 1)
 
 /* If we are generating ECOFF debugging information, we need some
    additional fields for each symbol.  */
@@ -157,10 +163,12 @@ extern void obj_elf_init_stab_section PA
   struct localsym *ecoff_symbol; \
   valueT ecoff_extern_size;
 
+#ifndef MIPS_STABS_ELF
 /* We smuggle stabs in ECOFF rather than using a separate section.
    The Irix linker can not handle a separate stabs section.  */
 #undef SEPARATE_STAB_SECTIONS
 #undef INIT_STAB_SECTION
+#endif /* MIPS_STABS_ELF */
 #define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \
   ecoff_stab ((seg), (what), (string), (type), (other), (desc))
 
diff -r -up gas-980329/gas/configure gas-980329.modified/gas/configure
--- gas-980329/gas/configure	Sun Mar 29 04:30:23 1998
+++ gas-980329.modified/gas/configure	Sun Mar 29 17:45:55 1998
@@ -1559,6 +1559,11 @@ EOF
       mips-*-lnews*)        fmt=ecoff em=lnews ;;
       mips-*-riscos*)       fmt=ecoff ;;
       mips-*-sysv*)         fmt=ecoff ;;
+      mips-*-vxworks)	    fmt=elf 
+                            cat >> confdefs.h <<\EOF
+#define MIPS_STABS_ELF 1
+EOF
+;;
       mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* |
mips-*-openbsd*)
 			    fmt=elf ;;
       mn10200-*-*)	    fmt=elf bfd_gas=yes ;;
diff -r -up gas-980329/gas/configure.in gas-980329.modified/gas/configure.in
--- gas-980329/gas/configure.in	Sun Mar 29 04:30:23 1998
+++ gas-980329.modified/gas/configure.in	Sun Mar 29 17:46:02 1998
@@ -230,6 +230,9 @@ changequote([,])dnl
       mips-*-lnews*)        fmt=ecoff em=lnews ;;
       mips-*-riscos*)       fmt=ecoff ;;
       mips-*-sysv*)         fmt=ecoff ;;
+      mips-*-vxworks)       fmt=elf 
+      		            AC_DEFINE(MIPS_STABS_ELF)
+      		            ;;
       mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* |
mips-*-openbsd*)
 			    fmt=elf ;;
       mn10200-*-*)	    fmt=elf bfd_gas=yes ;;
diff -r -up gas-980329/gas/ecoff.c gas-980329.modified/gas/ecoff.c
--- gas-980329/gas/ecoff.c	Sun Mar 29 04:10:15 1998
+++ gas-980329.modified/gas/ecoff.c	Sun Mar 29 18:26:30 1998
@@ -3567,11 +3567,18 @@ ecoff_stab (sec, what, string, type, oth
 	  value = get_absolute_expression ();
 	  addend = 0;
 	}
+#if 0
+/*
+ * I don't believe the comment at the top about input_line_pointer is
+ * correct: it points to the begging of the line, not the 
+ * value field of the stab
+*/
       else if (! is_name_beginner ((unsigned char) *input_line_pointer))
 	{
 	  as_warn ("Illegal .stab%c directive, bad character", what);
 	  return;
 	}
+#endif
       else
 	{
 	  expressionS exp;
diff -r -up gas-980329/ld/configure.tgt gas-980329.modified/ld/configure.tgt
--- gas-980329/ld/configure.tgt	Sun Mar 29 04:28:00 1998
+++ gas-980329.modified/ld/configure.tgt	Sun Mar 29 13:17:27 1998
@@ -157,6 +157,7 @@ mips*vr5000el-*-elf*)	targ_emul=elf32l43
 mips*vr5000-*-elf*)	targ_emul=elf32b4300 ;;
 mips*el-*-elf*)		targ_emul=elf32elmip ;;
 mips*-*-elf*)		targ_emul=elf32ebmip ;;
+mips*-wrs-vxworks*)	targ_emul=elf32ebmip ;;
 mips*-*-rtems*)		targ_emul=elf32ebmip ;;
 mips*el-*-linux-gnu*)	targ_emul=elf32lsmip
 			targ_extra_emuls="elf32bsmip mipslit mipsbig"
-----------END OF PATCH------------


--don bowman ( don@pixsci.com 519-884-4196 x2235 )

             reply	other threads:[~1998-03-29 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-29 15:46 Don Bowman [this message]
1998-03-30  8:34 ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3521B963898BD111AA6A006008A84516079B37@SERVER \
    --to=don@pixsci.com \
    --cc=gas2@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).