From: Nick Clifton Date: Mon, 21 Aug 2006 08:12:46 +0000 (+0000) Subject: bfd X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7148cc28af43c6070b99597651dc49ca475907bb;p=binutils-gdb.git bfd * Makefile.am: Add rules to build pe-arm-wince.lo and pei-arm-wince.lo objects. * Makefile.in: Regenerate. * pe-arm-wince.c: New file. * pei-arm-wince.c: New file. * pei-arm.c: Remove ARM_WINCE block. * pe-arm.c: Remove ARM_WINCE block. Rename bfd_arm_pe_allocate_interworking_sections, bfd_arm_pe_get_bfd_for_interworking, and bfd_arm_pe_process_before_allocation to bfd_armpe_allocate_interworking_sections, bfd_armpe_get_bfd_for_interworking, and bfd_armpe_process_before_allocation. Move them before including bfd.h. * bfd.c: ARM wince bfd format names were renamed. Adjust. * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up with unexpected/conflicting relocs. * targets.c: The arm-wince-pe target got its own new vector. Adjust. * config.bfd: Likewise. * configure.in: Likewise. * configure: Regenerate. binutils * configure.in: Split arm-pe and arm-wince-pe. Build dlltool with -DDLLTOOL_ARM_WINCE for Windows CE case. * configure: Regenerate. * dlltool.c: Add support for arm-wince. gas * Makefile.am (TARG_ENV_HFILES): Add te-wince-pe.h. * Makefile.in: Regenerate. * config/tc-arm.h [TARGET_FORMAT]: ARM wince bfd names were renamed. Adjust. ld * Makefile.am: Split arm-wince into its own emulation. * Makefile.in: Regenerate. * configure.tgt: Set targ_emul to arm_wince_pe for ARM Windows CE targets. * pe-dll.c : Define PE_ARCH_arm_wince. (pe_detail_list): Add PE_ARCH_arm_wince case. (make_one): Handle PE_ARCH_arm_epoc and PE_ARCH_arm_wince cases. * emulparams/arm_wince_pe.sh: New file. * emultempl/pe.em: Handle new TARGET_IS_arm_wince_pe define. Remap bfd_arm_allocate_interworking_sections, bfd_arm_get_bfd_for_interworking and bfd_arm_process_before_allocation for arm-pe and arm-wince-pe targets too. (gld_${EMULATION_NAME}_recognized_file): Handle arm-wince and arm-epoc bfd format names. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6136a0c3e97..595d19dde3a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,28 @@ +2006-08-21 Pedro Alves + + * Makefile.am: Add rules to build pe-arm-wince.lo + and pei-arm-wince.lo objects. + * Makefile.in: Regenerate. + * pe-arm-wince.c: New file. + * pei-arm-wince.c: New file. + * pei-arm.c: Remove ARM_WINCE block. + * pe-arm.c: Remove ARM_WINCE block. Rename + bfd_arm_pe_allocate_interworking_sections, + bfd_arm_pe_get_bfd_for_interworking, and + bfd_arm_pe_process_before_allocation to + bfd_armpe_allocate_interworking_sections, + bfd_armpe_get_bfd_for_interworking, and + bfd_armpe_process_before_allocation. Move them before + including bfd.h. + * bfd.c: ARM wince bfd format names were renamed. Adjust. + * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up + with unexpected/conflicting relocs. + * targets.c: The arm-wince-pe target got its own new vector. + Adjust. + * config.bfd: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + 2006-08-18 Paul Brook * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue. diff --git a/bfd/Makefile.am b/bfd/Makefile.am index cfc5f747c22..27c2c061737 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -323,6 +323,8 @@ BFD32_BACKENDS = \ pef.lo \ pe-arm.lo \ pei-arm.lo \ + pe-arm-wince.lo \ + pei-arm-wince.lo \ pe-i386.lo \ pei-i386.lo \ pe-mcore.lo \ @@ -495,6 +497,8 @@ BFD32_BACKENDS_CFILES = \ pef.c \ pe-arm.c \ pei-arm.c \ + pe-arm-wince.c \ + pei-arm-wince.c \ pe-i386.c \ pei-i386.c \ pe-mcore.c \ @@ -1622,6 +1626,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 0ecd81cbe4a..46673b6edb9 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -555,6 +555,8 @@ BFD32_BACKENDS = \ pef.lo \ pe-arm.lo \ pei-arm.lo \ + pe-arm-wince.lo \ + pei-arm-wince.lo \ pe-i386.lo \ pei-i386.lo \ pe-mcore.lo \ @@ -727,6 +729,8 @@ BFD32_BACKENDS_CFILES = \ pef.c \ pe-arm.c \ pei-arm.c \ + pe-arm-wince.c \ + pei-arm-wince.c \ pe-i386.c \ pei-i386.c \ pe-mcore.c \ @@ -2183,6 +2187,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h +pe-arm-wince.lo: pe-arm-wince.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-arm-wince.lo: pei-arm-wince.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/hashtab.h $(INCDIR)/coff/arm.h \ + $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ diff --git a/bfd/bfd.c b/bfd/bfd.c index cc0f73efc6f..13fbf93628a 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -876,7 +876,7 @@ bfd_get_sign_extend_vma (bfd *abfd) name = bfd_get_target (abfd); - /* Return a proper value for DJGPP & PE COFF (x86 COFF variants). + /* Return a proper value for DJGPP & PE COFF. This function is required for DWARF2 support, but there is no place to store this information in the COFF back end. Should enough other COFF targets add support for DWARF2, @@ -884,8 +884,8 @@ bfd_get_sign_extend_vma (bfd *abfd) if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0 || strcmp (name, "pe-i386") == 0 || strcmp (name, "pei-i386") == 0 - || strcmp (name, "pe-arm-little") == 0 - || strcmp (name, "pei-arm-little") == 0) + || strcmp (name, "pe-arm-wince-little") == 0 + || strcmp (name, "pei-arm-wince-little") == 0) return 1; bfd_set_error (bfd_error_wrong_format); diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 407004f4309..40420fa70a8 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -163,6 +163,19 @@ coff_arm_reloc (bfd *abfd, /* These most certainly belong somewhere else. Just had to get rid of the manifest constants in the code. */ + +#ifdef ARM_WINCE + +#define ARM_26D 0 +#define ARM_32 1 +#define ARM_RVA32 2 +#define ARM_26 3 +#define ARM_THUMB12 4 +#define ARM_SECTION 14 +#define ARM_SECREL 15 + +#else + #define ARM_8 0 #define ARM_16 1 #define ARM_32 2 @@ -179,20 +192,6 @@ coff_arm_reloc (bfd *abfd, #define ARM_THUMB12 13 #define ARM_THUMB23 14 -#ifdef ARM_WINCE -#undef ARM_32 -#undef ARM_RVA32 -#undef ARM_26 -#undef ARM_THUMB12 -#undef ARM_26D - -#define ARM_26D 0 -#define ARM_32 1 -#define ARM_RVA32 2 -#define ARM_26 3 -#define ARM_THUMB12 4 -#define ARM_SECTION 14 -#define ARM_SECREL 15 #endif static bfd_reloc_status_type aoutarm_fix_pcrel_26_done diff --git a/bfd/config.bfd b/bfd/config.bfd index 5b088905d97..22a7a11b62e 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -225,8 +225,8 @@ case "${targ}" in targ_cflags=-DARM_COFF_BUGFIX ;; arm-wince-pe | arm-*-wince) - targ_defvec=armpe_little_vec - targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec" + targ_defvec=arm_wince_pe_little_vec + targ_selvecs="arm_wince_pe_little_vec arm_wince_pe_big_vec arm_wince_pei_little_vec arm_wince_pei_big_vec" targ_underscore=no targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX" ;; diff --git a/bfd/configure b/bfd/configure index b047aa34ae4..c7d5a4327fe 100755 --- a/bfd/configure +++ b/bfd/configure @@ -10783,6 +10783,10 @@ do arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; diff --git a/bfd/configure.in b/bfd/configure.in index bf6d8ebbaaf..95b126a7be2 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -573,6 +573,10 @@ do arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_big_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pe_little_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_big_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_wince_pei_little_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;; armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; diff --git a/bfd/pe-arm-wince.c b/bfd/pe-arm-wince.c new file mode 100644 index 00000000000..57f8bcf3450 --- /dev/null +++ b/bfd/pe-arm-wince.c @@ -0,0 +1,35 @@ +/* BFD back-end for ARM WINCE PE files. + Copyright 2006 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#define TARGET_UNDERSCORE 0 +#define USER_LABEL_PREFIX "" + +#define TARGET_LITTLE_SYM arm_wince_pe_little_vec +#define TARGET_LITTLE_NAME "pe-arm-wince-little" +#define TARGET_BIG_SYM arm_wince_pe_big_vec +#define TARGET_BIG_NAME "pe-arm-wince-big" + +#define bfd_arm_allocate_interworking_sections \ + bfd_arm_wince_pe_allocate_interworking_sections +#define bfd_arm_get_bfd_for_interworking \ + bfd_arm_wince_pe_get_bfd_for_interworking +#define bfd_arm_process_before_allocation \ + bfd_arm_wince_pe_process_before_allocation + +#include "pe-arm.c" diff --git a/bfd/pe-arm.c b/bfd/pe-arm.c index 41c7ba99966..29fdfedfdc2 100644 --- a/bfd/pe-arm.c +++ b/bfd/pe-arm.c @@ -17,6 +17,17 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +/* Do this before including bfd.h, so we prototype the right functions. */ + +#ifndef bfd_arm_allocate_interworking_sections +#define bfd_arm_allocate_interworking_sections \ + bfd_armpe_allocate_interworking_sections +#define bfd_arm_get_bfd_for_interworking \ + bfd_armpe_get_bfd_for_interworking +#define bfd_arm_process_before_allocation \ + bfd_armpe_process_before_allocation +#endif + #include "bfd.h" #include "sysdep.h" @@ -31,19 +42,6 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define PCRELOFFSET TRUE #define COFF_LONG_SECTION_NAMES -#ifndef bfd_arm_allocate_interworking_sections -#define bfd_arm_allocate_interworking_sections \ - bfd_arm_pe_allocate_interworking_sections -#define bfd_arm_get_bfd_for_interworking \ - bfd_arm_pe_get_bfd_for_interworking -#define bfd_arm_process_before_allocation \ - bfd_arm_pe_process_before_allocation -#endif - -#ifdef ARM_WINCE -#define TARGET_UNDERSCORE 0 -#endif - #define COFF_SECTION_ALIGNMENT_ENTRIES \ { COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ diff --git a/bfd/pei-arm-wince.c b/bfd/pei-arm-wince.c new file mode 100644 index 00000000000..48269c9994a --- /dev/null +++ b/bfd/pei-arm-wince.c @@ -0,0 +1,28 @@ +/* BFD back-end for ARM WINCE PE IMAGE COFF files. + Copyright 2006 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#define TARGET_UNDERSCORE 0 +#define USER_LABEL_PREFIX "" + +#define TARGET_LITTLE_SYM arm_wince_pei_little_vec +#define TARGET_LITTLE_NAME "pei-arm-wince-little" +#define TARGET_BIG_SYM arm_wince_pei_big_vec +#define TARGET_BIG_NAME "pei-arm-wince-big" + +#include "pei-arm.c" diff --git a/bfd/pei-arm.c b/bfd/pei-arm.c index cba19ded438..79a1e3c476c 100644 --- a/bfd/pei-arm.c +++ b/bfd/pei-arm.c @@ -32,10 +32,6 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #define PCRELOFFSET TRUE #define COFF_LONG_SECTION_NAMES -#ifdef ARM_WINCE -# define TARGET_UNDERSCORE 0 -#endif - #define COFF_SECTION_ALIGNMENT_ENTRIES \ { COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ diff --git a/bfd/targets.c b/bfd/targets.c index 306bf278d43..3471c25f800 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -541,6 +541,10 @@ extern const bfd_target arm_epoc_pe_big_vec; extern const bfd_target arm_epoc_pe_little_vec; extern const bfd_target arm_epoc_pei_big_vec; extern const bfd_target arm_epoc_pei_little_vec; +extern const bfd_target arm_wince_pe_big_vec; +extern const bfd_target arm_wince_pe_little_vec; +extern const bfd_target arm_wince_pei_big_vec; +extern const bfd_target arm_wince_pei_little_vec; extern const bfd_target armcoff_big_vec; extern const bfd_target armcoff_little_vec; extern const bfd_target armnetbsd_vec; @@ -844,6 +848,10 @@ static const bfd_target * const _bfd_target_vector[] = { &arm_epoc_pe_little_vec, &arm_epoc_pei_big_vec, &arm_epoc_pei_little_vec, + &arm_wince_pe_big_vec, + &arm_wince_pe_little_vec, + &arm_wince_pei_big_vec, + &arm_wince_pei_little_vec, &armcoff_big_vec, &armcoff_little_vec, &armnetbsd_vec, diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 1d6be27841a..fc360b0a2b1 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2006-08-21 Pedro Alves + + * configure.in: Split arm-pe and arm-wince-pe. Build dlltool + with -DDLLTOOL_ARM_WINCE for Windows CE case. + * configure: Regenerate. + * dlltool.c: Add support for arm-wince. + 2006-08-15 Nick Clifton PR binutils/3039 diff --git a/binutils/configure b/binutils/configure index 18233376736..505a1e495f1 100755 --- a/binutils/configure +++ b/binutils/configure @@ -5308,8 +5308,9 @@ INCINTL= XGETTEXT= GMSGFMT= POSUB= -if test -f ../intl/config.intl; then - . ../intl/config.intl + +if test -f ../intl/config.intl; then + . ../intl/config.intl fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 @@ -8429,7 +8430,12 @@ do DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - arm-*-pe* | arm-*-wince) + arm-wince-pe* | arm-*-wince) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + ;; + arm-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' diff --git a/binutils/configure.in b/binutils/configure.in index 0883d6b439c..95a26cccd50 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -242,7 +242,12 @@ changequote([,])dnl DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - arm-*-pe* | arm-*-wince) + arm-wince-pe* | arm-*-wince) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + ;; + arm-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 6c231f69a44..8cf972e318f 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -385,8 +385,10 @@ static FILE *output_def; static FILE *base_file; #ifdef DLLTOOL_ARM -#ifdef DLLTOOL_ARM_EPOC +#if defined(DLLTOOL_ARM_EPOC) static const char *mname = "arm-epoc"; +#elif defined(DLLTOOL_ARM_WINCE) +static const char *mname = "arm-wince"; #else static const char *mname = "arm"; #endif @@ -629,6 +631,15 @@ mtable[] = arm_jtab, sizeof (arm_jtab), 8 } , + { +#define MARM_WINCE 10 + "arm-wince", ".byte", ".short", ".long", ".asciz", "@", + "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long", + ".global", ".space", ".align\t2",".align\t4", "-mapcs-32", + "pe-arm-wince-little", bfd_arch_arm, + arm_jtab, sizeof (arm_jtab), 8 + } + , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -760,6 +771,7 @@ rvaafter (int machine) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: break; default: /* xgettext:c-format */ @@ -784,6 +796,7 @@ rvabefore (int machine) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: return ".rva\t"; default: /* xgettext:c-format */ @@ -807,6 +820,7 @@ asm_prefix (int machine, const char *name) case MMCORE_ELF: case MMCORE_ELF_LE: case MARM_EPOC: + case MARM_WINCE: break; case M386: /* Symbol names starting with ? do not have a leading underscore. */ diff --git a/gas/ChangeLog b/gas/ChangeLog index 6c7928d3a77..d9b215f7e90 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2006-08-22 Pedro Alves + + * Makefile.am (TARG_ENV_HFILES): Add te-wince-pe.h. + * Makefile.in: Regenerate. + * config/tc-arm.h [TARGET_FORMAT]: ARM wince bfd names were + renamed. Adjust. + 2006-08-16 Julian Brown * config/tc-arm.c (md_assemble): Improve diagnostic when attempting diff --git a/gas/Makefile.am b/gas/Makefile.am index 973b13e2d90..dbf3dee45ce 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -381,7 +381,8 @@ TARG_ENV_HFILES = \ config/te-sun3.h \ config/te-svr4.h \ config/te-symbian.h \ - config/te-tmips.h + config/te-tmips.h \ + config/te-wince-pe.h # Multi files in config diff --git a/gas/Makefile.in b/gas/Makefile.in index 0cfadba4198..dd07dc66a37 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -608,7 +608,8 @@ TARG_ENV_HFILES = \ config/te-sun3.h \ config/te-svr4.h \ config/te-symbian.h \ - config/te-tmips.h + config/te-tmips.h \ + config/te-wince-pe.h # Multi files in config diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index c04a35b1bb2..cf74326901f 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -66,6 +66,8 @@ struct fix; # if defined TE_PE # if defined TE_EPOC # define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little") +# elif defined TE_WINCE +# define TARGET_FORMAT (target_big_endian ? "pe-arm-wince-big" : "pe-arm-wince-little") # else # define TARGET_FORMAT (target_big_endian ? "pe-arm-big" : "pe-arm-little") # endif diff --git a/ld/ChangeLog b/ld/ChangeLog index 698f0eb27ff..cadb3f003dc 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,21 @@ +2006-08-22 Pedro Alves + + * Makefile.am: Split arm-wince into its own emulation. + * Makefile.in: Regenerate. + * configure.tgt: Set targ_emul to arm_wince_pe for ARM Windows + CE targets. + * pe-dll.c : Define PE_ARCH_arm_wince. + (pe_detail_list): Add PE_ARCH_arm_wince case. + (make_one): Handle PE_ARCH_arm_epoc and PE_ARCH_arm_wince cases. + * emulparams/arm_wince_pe.sh: New file. + * emultempl/pe.em: Handle new TARGET_IS_arm_wince_pe define. + Remap bfd_arm_allocate_interworking_sections, + bfd_arm_get_bfd_for_interworking and + bfd_arm_process_before_allocation for arm-pe and arm-wince-pe + targets too. + (gld_${EMULATION_NAME}_recognized_file): Handle arm-wince and + arm-epoc bfd format names. + 2006-08-18 Paul Brook * emultempl/armelf.em (arm_elf_before_allocation): Call diff --git a/ld/Makefile.am b/ld/Makefile.am index f91e897f59b..29738a6727f 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -108,6 +108,7 @@ ALL_EMULATIONS = \ ealpha.o \ earcelf.o \ earm_epoc_pe.o \ + earm_wince_pe.o \ earmaoutb.o \ earmaoutl.o \ earmcoff.o \ @@ -569,6 +570,9 @@ earmnto.c: $(srcdir)/emulparams/armnto.sh \ earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS} ${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)" +earm_wince_pe.c: $(srcdir)/emulparams/arm_wince_pe.sh \ + $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} + ${GENSCRIPTS} arm_wince_pe "$(tdir_armpe)" earmpe.c: $(srcdir)/emulparams/armpe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} armpe "$(tdir_armpe)" diff --git a/ld/Makefile.in b/ld/Makefile.in index afc3f5ecabf..63d019280bd 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -332,6 +332,7 @@ ALL_EMULATIONS = \ ealpha.o \ earcelf.o \ earm_epoc_pe.o \ + earm_wince_pe.o \ earmaoutb.o \ earmaoutl.o \ earmcoff.o \ @@ -1380,6 +1381,9 @@ earmnto.c: $(srcdir)/emulparams/armnto.sh \ earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS} ${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)" +earm_wince_pe.c: $(srcdir)/emulparams/arm_wince_pe.sh \ + $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} + ${GENSCRIPTS} arm_wince_pe "$(tdir_armpe)" earmpe.c: $(srcdir)/emulparams/armpe.sh \ $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} ${GENSCRIPTS} armpe "$(tdir_armpe)" diff --git a/ld/emulparams/arm_wince_pe.sh b/ld/emulparams/arm_wince_pe.sh new file mode 100644 index 00000000000..2d0019fc47a --- /dev/null +++ b/ld/emulparams/arm_wince_pe.sh @@ -0,0 +1,14 @@ +ARCH=arm +SCRIPT_NAME=pe + +OUTPUT_FORMAT="pei-arm-wince-little" +LITTLE_OUTPUT_FORMAT="pei-arm-wince-little" +BIG_OUTPUT_FORMAT="pei-arm-wince-big" + +RELOCATEABLE_OUTPUT_FORMAT="pe-arm-wince-little" + +TEMPLATE_NAME=pe +ENTRY="WinMainCRTStartup" +SUBSYSTEM=PE_DEF_SUBSYSTEM +INITIAL_SYMBOL_CHAR=\"\" +TARGET_PAGE_SIZE=0x1000 diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 90e947875cf..0e75e182c54 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -37,15 +37,18 @@ cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <the_bfd, & link_info)) + if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info)) break; } } @@ -1267,7 +1272,7 @@ gld_${EMULATION_NAME}_before_allocation (void) ppc_allocate_toc_section (&link_info); #endif /* TARGET_IS_ppcpe */ -#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) +#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe) /* FIXME: we should be able to set the size of the interworking stub section. @@ -1277,7 +1282,7 @@ gld_${EMULATION_NAME}_before_allocation (void) { LANG_FOR_EACH_INPUT_STATEMENT (is) { - if (! bfd_arm_pe_process_before_allocation + if (! bfd_arm_process_before_allocation (is->the_bfd, & link_info, support_old_code)) { /* xgettext:c-format */ @@ -1288,8 +1293,8 @@ gld_${EMULATION_NAME}_before_allocation (void) } /* We have seen it all. Allocate it, and carry on. */ - bfd_arm_pe_allocate_interworking_sections (& link_info); -#endif /* TARGET_IS_armpe */ + bfd_arm_allocate_interworking_sections (& link_info); +#endif /* TARGET_IS_armpe || TARGET_IS_arm_epoc_pe || TARGET_IS_arm_wince_pe */ before_allocation_default (); } @@ -1403,6 +1408,12 @@ gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUT #endif #ifdef TARGET_IS_armpe pe_dll_id_target ("pei-arm-little"); +#endif +#ifdef TARGET_IS_arm_epoc_pe + pe_dll_id_target ("epoc-pei-arm-little"); +#endif +#ifdef TARGET_IS_arm_wince_pe + pe_dll_id_target ("pei-arm-wince-little"); #endif if (bfd_get_format (entry->the_bfd) == bfd_object) { @@ -1424,7 +1435,7 @@ gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUT static void gld_${EMULATION_NAME}_finish (void) { -#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) +#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe) struct bfd_link_hash_entry * h; if (thumb_entry_symbol != NULL) @@ -1464,7 +1475,7 @@ gld_${EMULATION_NAME}_finish (void) else einfo (_("%P: warning: connot find thumb start symbol %s\n"), thumb_entry_symbol); } -#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) */ +#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe) */ finish_default (); diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 725d6c110db..8af1b063904 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -207,6 +207,7 @@ static autofilter_entry_type autofilter_symbollist_i386[] = #define PE_ARCH_mips 3 #define PE_ARCH_arm 4 #define PE_ARCH_arm_epoc 5 +#define PE_ARCH_arm_wince 6 static pe_details_type pe_detail_list[] = { @@ -255,6 +256,15 @@ static pe_details_type pe_detail_list[] = FALSE, autofilter_symbollist_generic }, + { + "pei-arm-wince-little", + "pe-arm-wince-little", + 2, /* ARM_RVA32 on Windows CE, see bfd/coff-arm.c. */ + PE_ARCH_arm_wince, + bfd_arch_arm, + FALSE, + autofilter_symbollist_generic + }, { NULL, NULL, 0, 0, 0, FALSE, NULL } }; @@ -1837,6 +1847,8 @@ make_one (def_file_export *exp, bfd *parent) jmp_byte_count = sizeof (jmp_mips_bytes); break; case PE_ARCH_arm: + case PE_ARCH_arm_epoc: + case PE_ARCH_arm_wince: jmp_bytes = jmp_arm_bytes; jmp_byte_count = sizeof (jmp_arm_bytes); break; @@ -1914,6 +1926,8 @@ make_one (def_file_export *exp, bfd *parent) quick_reloc (abfd, 4, BFD_RELOC_LO16, 2); break; case PE_ARCH_arm: + case PE_ARCH_arm_epoc: + case PE_ARCH_arm_wince: quick_reloc (abfd, 8, BFD_RELOC_32, 2); break; default: