diff options
author | Nick Clifton <nickc@redhat.com> | 2000-02-24 19:49:18 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-02-24 19:49:18 +0000 |
commit | 056350c6bd025c6b73b25f39247c890581b215b1 (patch) | |
tree | 3ee95df831c15874e7550cddf4a55cdc2002dfdd /gas/config | |
parent | 8a0e0f38af77d6c38cdf9a257b55b4a06ce09124 (diff) | |
download | gdb-056350c6bd025c6b73b25f39247c890581b215b1.zip gdb-056350c6bd025c6b73b25f39247c890581b215b1.tar.gz gdb-056350c6bd025c6b73b25f39247c890581b215b1.tar.bz2 |
Add support for WinCE targeted toolchains.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/obj-coff.h | 17 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 26 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 16 | ||||
-rw-r--r-- | gas/config/tc-mips.h | 3 | ||||
-rw-r--r-- | gas/config/tc-sh.c | 7 | ||||
-rw-r--r-- | gas/config/tc-sh.h | 6 | ||||
-rw-r--r-- | gas/config/te-wince-pe.h | 2 |
7 files changed, 69 insertions, 8 deletions
diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index a616872..f60ae36 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -110,12 +110,29 @@ #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" diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 86e3600..f8f43be 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -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); diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index b8b8c46..9426519 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -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 diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h index a17c642..1008b75 100644 --- a/gas/config/tc-mips.h +++ b/gas/config/tc-mips.h @@ -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)); diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 777d76c..66dbb5b 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -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 */ diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h index 90129c2..099e915 100644 --- a/gas/config/tc-sh.h +++ b/gas/config/tc-sh.h @@ -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 index 0000000..d1193b8 --- /dev/null +++ b/gas/config/te-wince-pe.h @@ -0,0 +1,2 @@ +#define TE_WINCE +#include "te-pe.h" |