OSDN Git Service

Add support for WinCE targeted toolchains.
authornickc <nickc>
Thu, 24 Feb 2000 19:46:27 +0000 (19:46 +0000)
committernickc <nickc>
Thu, 24 Feb 2000 19:46:27 +0000 (19:46 +0000)
gas/ChangeLog
gas/config/obj-coff.h
gas/config/tc-arm.c
gas/config/tc-mips.c
gas/config/tc-mips.h
gas/config/tc-sh.c
gas/config/tc-sh.h
gas/config/te-wince-pe.h [new file with mode: 0644]
gas/configure
gas/configure.in

index 5f9004c..574ac0a 100644 (file)
@@ -1,3 +1,33 @@
+2000-02-24  Nick Clifton  <nickc@cygnus.com>
+
+       * configure: Add arm-wince, mips-pe and sh-pe targets.
+       * configure: Regenerate.
+
+       * config/obj-coff.h (COFF_WITH_PE): Define for mips-pe and
+       sh-pe targets.
+       (TARGET_FORMAT): Set to "pe-shl" for the sh-pe target and to
+       "pe-mips" for the mips-pe target.
+
+       * config/tc-arm.c (insns): Change displacement encoded in BL
+       and B instructions if the target port is arm-wince.
+       (do_ldst): Do not bias the relocation offset if the target
+       port is arm-wince.
+       (md_pcrel_from): Add in missing relocation offset bias if the
+       target os arm-wince.
+
+       * config/tc-mips.c (mips_target_format): Support COFF flavour.
+       (md_begin): Disable -G support for mips-pe target.
+       (md_apply_fix): Treat BFD_RELOC_RVA reloc as BFD_RELOC_32.
+       * config/tc-mips.h (USE_GLOBAL_POINTER_OPT): Add support for
+       COFF flavour.
+
+       * config/tc-sh.c (md_begin): sh-pe target is little endian.
+       * config/tc-sh.h (SUB_SEGMENT_ALIGN): If using a BFD
+       assembler, just set the alignment to 4.
+
+       * config/te-wince-pe.h: New file for WinCE targets.  Define
+       TE_WINCE.
+
 2000-02-25  Alan Modra  <alan@spri.levels.unisa.edu.au>
 
        * config/tc-i386.c (md_assemble): Swap segments too for intel mode
index a616872..f60ae36 100644 (file)
 #endif
 
 #ifdef TC_SH
+
+#ifdef TE_PE
+#define COFF_WITH_PE
+#endif
+
 #include "coff/sh.h"
+
+#ifdef TE_PE
+#define TARGET_FORMAT "pe-shl"
+#else
 #define TARGET_FORMAT                                  \
   (shl                                                 \
    ? (sh_small ? "coff-shl-small" : "coff-shl")                \
    : (sh_small ? "coff-sh-small" : "coff-sh"))
 #endif
+#endif
+
+#ifdef TC_MIPS
+#define COFF_WITH_PE
+#include "coff/mipspe.h"
+#undef  TARGET_FORMAT
+#define TARGET_FORMAT "pe-mips"
+#endif
 
 #ifdef TC_M88K
 #include "coff/m88k.h"
index 86e3600..f8f43be 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-arm.c -- Assemble for the ARM
-   Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994, 95, 96, 97, 98, 1999, 2000 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
        Modified by David Taylor (dtaylor@armltd.co.uk)
 
@@ -54,7 +54,7 @@
 #define ARM_EXT_V5     0x00000080      /* allow CLZ etc         */
 #define ARM_EXT_V5E     0x00000200     /* "El Segundo"          */
 
-/* Architectures are the sum of the base and extensions */
+/* Architectures are the sum of the base and extensions */
 #define ARM_ARCH_V4    (ARM_7 | ARM_LONGMUL | ARM_HALFWORD)
 #define ARM_ARCH_V4T   (ARM_ARCH_V4 | ARM_THUMB)
 #define ARM_ARCH_V5    (ARM_ARCH_V4 | ARM_EXT_V5)
@@ -547,9 +547,14 @@ static CONST struct asm_opcode insns[] =
   {"stm",   0x08000000, NULL,   stm_flags,   ARM_ANY,      do_ldmstm},
   {"ldm",   0x08100000, NULL,   ldm_flags,   ARM_ANY,      do_ldmstm},
   {"swi",   0x0f000000, NULL,   NULL,        ARM_ANY,      do_swi},
+#ifdef TE_WINCE
+  {"bl",    0x0b000000, NULL,   NULL,        ARM_ANY,      do_branch},
+  {"b",     0x0a000000, NULL,   NULL,        ARM_ANY,      do_branch},
+#else
   {"bl",    0x0bfffffe, NULL,   NULL,        ARM_ANY,      do_branch},
   {"b",     0x0afffffe, NULL,   NULL,        ARM_ANY,      do_branch},
-
+#endif
+  
 /* Pseudo ops */
   {"adr",   0x028f0000, NULL,   NULL,        ARM_ANY,      do_adr},
   {"adrl",  0x028f0000, NULL,   NULL,        ARM_ANY,      do_adrl},
@@ -3020,7 +3025,9 @@ do_ldst (str, flags)
         }
       else
         inst.reloc.type = BFD_RELOC_ARM_OFFSET_IMM;
+#ifndef TE_WINCE
       inst.reloc.exp.X_add_number -= 8;  /* PC rel adjust */
+#endif
       inst.reloc.pc_rel = 1;
       inst.instruction |= (REG_PC << 16);
       pre_inc = 1;
@@ -4116,6 +4123,7 @@ thumb_add_sub (str, subtract)
            }
        }
     }
+  
   end_of_line (str);
 }
 
@@ -4140,7 +4148,7 @@ thumb_shift (str, shift)
     {
       /* Two operand immediate format, set Rs to Rd.  */
       Rs = Rd;
-      str++;
+      str ++;
       if (my_get_expression (&inst.reloc.exp, &str))
        return;
     }
@@ -4225,6 +4233,7 @@ thumb_shift (str, shift)
 
       inst.instruction |= Rd | (Rs << 3);
     }
+  
   end_of_line (str);
 }
 
@@ -5206,7 +5215,13 @@ md_pcrel_from (fixP)
       return (fixP->fx_where + fixP->fx_frag->fr_address) & ~3;
     }
 
+#ifdef TE_WINCE
+  /* The pattern was adjusted to accomodate CE's off-by-one fixups,
+     so we un-adjust here to compensate for the accomodation.  */
+  return fixP->fx_where + fixP->fx_frag->fr_address + 8;
+#else
   return fixP->fx_where + fixP->fx_frag->fr_address;
+#endif
 }
 
 /* Round up a section size to the appropriate boundary. */
@@ -6890,13 +6905,14 @@ arm_adjust_symtab ()
 #endif
 #ifdef OBJ_ELF
   symbolS *         sym;
-  elf_symbol_type * elf_sym;
   char              bind;
 
   for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
     {
       if (ARM_IS_THUMB (sym))
         {
+         elf_symbol_type * elf_sym;
+         
          elf_sym = elf_symbol (symbol_get_bfdsym (sym));
          bind = ELF_ST_BIND (elf_sym);
          
index b8b8c46..9426519 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-mips.c -- assemble code for a MIPS chip.
-   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999, 2000 Free Software Foundation, Inc.
    Contributed by the OSF and Ralph Campbell.
    Written by Keith Knowles and Ralph Campbell, working independently.
    Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus
@@ -118,6 +118,8 @@ mips_target_format ()
       return target_big_endian ? "a.out-mips-big" : "a.out-mips-little";
     case bfd_target_ecoff_flavour:
       return target_big_endian ? "ecoff-bigmips" : ECOFF_LITTLE_FORMAT;
+    case bfd_target_coff_flavour:
+      return "pe-mips";
     case bfd_target_elf_flavour:
       return (target_big_endian
              ? (mips_64 ? "elf64-bigmips" : "elf32-bigmips")
@@ -133,6 +135,8 @@ mips_target_format ()
                            ? ".data" \
                            : OUTPUT_FLAVOR == bfd_target_ecoff_flavour \
                            ? ".rdata" \
+                           : OUTPUT_FLAVOR == bfd_target_coff_flavour \
+                           ? ".rdata" \
                            : OUTPUT_FLAVOR == bfd_target_elf_flavour \
                            ? ".rodata" \
                            : (abort (), ""))
@@ -848,6 +852,15 @@ md_begin ()
   int broken = 0;
   int mips_isa_from_cpu;
 
+  /* GP relative stuff not working for PE */
+  if (strncmp (TARGET_OS, "pe", 2) == 0
+      && g_switch_value != 0)
+    {
+      if (g_switch_seen)
+       as_bad (_("-G not supported in this configuration."));
+      g_switch_value = 0;
+    }
+
   cpu = TARGET_CPU;
   if (strcmp (cpu + (sizeof TARGET_CPU) - 3, "el") == 0)
     {
@@ -9645,6 +9658,7 @@ md_apply_fix (fixP, valueP)
        }
       break;
 
+    case BFD_RELOC_RVA:
     case BFD_RELOC_32:
       /* If we are deleting this reloc entry, we must fill in the
         value now.  This can happen if we have a .word which is not
index a17c642..1008b75 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-mips.h -- header file for tc-mips.c.
-   Copyright (C) 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 1999, 2000 Free Software Foundation, Inc.
    Contributed by the OSF and Ralph Campbell.
    Written by Keith Knowles and Ralph Campbell, working independently.
    Modified for ECOFF support by Ian Lance Taylor of Cygnus Support.
@@ -142,6 +142,7 @@ extern void md_mips_end PARAMS ((void));
 #define md_end()       md_mips_end()
 
 #define USE_GLOBAL_POINTER_OPT (OUTPUT_FLAVOR == bfd_target_ecoff_flavour \
+                                || OUTPUT_FLAVOR == bfd_target_coff_flavour \
                                 || OUTPUT_FLAVOR == bfd_target_elf_flavour)
 
 extern void mips_pop_insert PARAMS ((void));
index 777d76c..66dbb5b 100644 (file)
@@ -206,8 +206,13 @@ md_begin ()
   char *prev_name = "";
   int target_arch;
 
+#ifdef TE_PE
+  /* The WinCE OS only supports little endian executables.  */
+  target_big_endian = 0;
+#else
   if (! shl)
     target_big_endian = 1;
+#endif
 
   target_arch = arch_sh1_up & ~(sh_dsp ? arch_sh3e_up : arch_sh_dsp_up);
   valid_arch = target_arch;
@@ -1678,6 +1683,7 @@ DEFUN (md_undefined_symbol, (name),
 }
 
 #ifdef OBJ_COFF
+#ifndef BFD_ASSEMBLER
 
 void
 DEFUN (tc_crawl_symbol_chain, (headers),
@@ -1694,6 +1700,7 @@ DEFUN (tc_headers_hook, (headers),
 }
 
 #endif
+#endif
 
 /* Various routines to kill one day */
 /* Equal to MAX_PRECISION in atof-ieee.c */
index 90129c2..099e915 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is tc-sh.h
-   Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -129,6 +129,9 @@ extern void sh_coff_reloc_mangle
 #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag)
 extern int tc_coff_sizemachdep PARAMS ((fragS *));
 
+#ifdef BFD_ASSEMBLER
+#define SUB_SEGMENT_ALIGN(SEG) 4
+#else
 /* We align most sections to a 16 byte boundary.  */
 #define SUB_SEGMENT_ALIGN(SEG)                                 \
   (strncmp (obj_segment_name (SEG), ".stabstr", 8) == 0                \
@@ -138,6 +141,7 @@ extern int tc_coff_sizemachdep PARAMS ((fragS *));
        || strcmp (obj_segment_name (SEG), ".dtors") == 0)      \
       ? 2                                                      \
       : (sh_small ? 2 : 4)))
+#endif
 
 #endif /* OBJ_COFF */
 
diff --git a/gas/config/te-wince-pe.h b/gas/config/te-wince-pe.h
new file mode 100644 (file)
index 0000000..d1193b8
--- /dev/null
@@ -0,0 +1,2 @@
+#define TE_WINCE
+#include "te-pe.h"
index 6bcc0d3..62d35d1 100755 (executable)
@@ -2089,6 +2089,7 @@ for this_target in $target $canon_targets ; do
       arm-*-netbsd*)                   fmt=aout em=nbsd bfd_gas=yes ;;
       arm-*-oabi | thumb-*-oabi)        fmt=elf ;;
       arm-epoc-pe | thumb-epoc-pe)      fmt=coff em=epoc-pe ;;
+      arm-*-wince)         fmt=coff em=wince-pe bfd_gas=yes;;
       arm-*-pe | thumb-*-pe)            fmt=coff em=pe ;;
       arm-*-riscix*)                   fmt=aout em=riscix ;;
 
@@ -2203,6 +2204,7 @@ EOF
       mips-*-osf*)          fmt=ecoff endian=little ;;
       mips-*-ecoff*)        fmt=ecoff ;;
       mips-*-ecoff*)        fmt=ecoff ;;
+      mips-*-pe*)           fmt=coff endian=little em=pe ;;
       mips-*-irix6*)       fmt=elf ;;
       mips-*-irix5*)        fmt=elf ;;
       mips-*-irix*)         fmt=ecoff ;;
@@ -2251,6 +2253,7 @@ EOF
 
       sh-*-elf*)           fmt=elf ;;
       sh-*-coff*)           fmt=coff ;;
+      sh-*-pe*)             fmt=coff em=pe bfd_gas=yes;;
       sh-*-rtemself*)       fmt=elf ;;
       sh-*-rtems*)         fmt=coff ;;
 
index b6d6d0b..361ae64 100644 (file)
@@ -155,6 +155,7 @@ changequote([,])dnl
       arm-*-netbsd*)                   fmt=aout em=nbsd bfd_gas=yes ;;
       arm-*-oabi | thumb-*-oabi)        fmt=elf ;;
       arm-epoc-pe | thumb-epoc-pe)      fmt=coff em=epoc-pe ;;
+      arm-*-wince)          fmt=coff em=wince-pe bfd_gas=yes;;
       arm-*-pe | thumb-*-pe)            fmt=coff em=pe ;;
       arm-*-riscix*)                   fmt=aout em=riscix ;;
 
@@ -267,6 +268,7 @@ changequote([,])dnl
       mips-*-osf*)          fmt=ecoff endian=little ;;
       mips-*-ecoff*)        fmt=ecoff ;;
       mips-*-ecoff*)        fmt=ecoff ;;
+      mips-*-pe*)           fmt=coff endian=little em=pe ;;
       mips-*-irix6*)       fmt=elf ;;
       mips-*-irix5*)        fmt=elf ;;
       mips-*-irix*)         fmt=ecoff ;;
@@ -311,6 +313,7 @@ changequote([,])dnl
 
       sh-*-elf*)           fmt=elf ;;
       sh-*-coff*)           fmt=coff ;;
+      sh-*-pe*)             fmt=coff em=pe bfd_gas=yes;;
       sh-*-rtemself*)       fmt=elf ;;
       sh-*-rtems*)         fmt=coff ;;