From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Bowman To: "'gas2@cygnus.com'" Subject: Patch for binutils (GAS-980329) for VxWorks on MIPS, take 2 Date: Mon, 30 Mar 1998 17:50:00 -0000 Message-id: <3521B963898BD111AA6A006008A84516079B53@SERVER> X-SW-Source: 1998/msg00075.html I'm resubmitting this patch, there was an error in the previous one regarding the use of ecoff_stabs. 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 two 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. This patch is against GAS-980329 The Changelog entries would be something like: bfd: Sun Mar 29 18:32:00 1998 Don Bowman * config.bfd: add mips*el-wrs-vxworks and mips*-wrs-vxworks gas: Sun Mar 29 18:32:00 1998 Don Bowman * 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 * acconfig.h: add MIPS_STABS_ELF as a configurable option 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/acconfig.h gas-980329.modified/gas/acconfig.h --- gas-980329/gas/acconfig.h Sun Mar 29 04:10:13 1998 +++ gas-980329.modified/gas/acconfig.h Mon Mar 30 20:01:41 1998 @@ -77,3 +77,6 @@ /* Needed only for SCO 5. */ #undef SCO_ELF + +/* needed for non irix ELF targets */ +#undef MIPS_STABS_ELF Only in gas-980329.modified/gas/config: a.out 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 Mon Mar 30 20:12:33 1998 @@ -141,12 +141,17 @@ extern void obj_elf_init_stab_section PA #define ECOFF_DEBUGGING 1 #endif + /* 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) || defined(MIPS_STABS_ELF) /* If we are generating ECOFF debugging information, we need some additional fields for each symbol. */ @@ -157,6 +162,7 @@ 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 @@ -167,6 +173,7 @@ extern void obj_elf_init_stab_section PA #define OBJ_GENERATE_ASM_LINENO(filename, lineno) \ ecoff_generate_asm_lineno ((filename), (lineno)) +#endif /* MIPS_STABS_ELF */ #endif /* ECOFF_DEBUGGING */ extern void elf_frob_symbol PARAMS ((struct symbol *, int *)); diff -r -up gas-980329/gas/config.in gas-980329.modified/gas/config.in --- gas-980329/gas/config.in Sun Mar 29 04:10:14 1998 +++ gas-980329.modified/gas/config.in Mon Mar 30 20:01:49 1998 @@ -108,6 +108,9 @@ /* Needed only for SCO 5. */ #undef SCO_ELF +/* needed for non irix ELF targets */ +#undef MIPS_STABS_ELF + /* Define if you have the remove function. */ #undef HAVE_REMOVE 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/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 )