* 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.
This commit is contained in:
Nick Clifton 2006-08-21 08:12:46 +00:00
parent 1f01065bba
commit 7148cc28af
27 changed files with 308 additions and 75 deletions

View File

@ -1,3 +1,28 @@
2006-08-21 Pedro Alves <pedro_alves@portugalmail.pt>
* 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 <paul@codesourcery.com>
* elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue.

View File

@ -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 \

View File

@ -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 \

View File

@ -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);

View File

@ -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

View File

@ -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"
;;

4
bfd/configure vendored
View File

@ -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" ;;

View File

@ -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" ;;

35
bfd/pe-arm-wince.c Normal file
View File

@ -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"

View File

@ -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 }, \

28
bfd/pei-arm-wince.c Normal file
View File

@ -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"

View File

@ -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 }, \

View File

@ -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,

View File

@ -1,3 +1,10 @@
2006-08-21 Pedro Alves <pedro_alves@portugalmail.pt>
* 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 <nickc@redhat.com>
PR binutils/3039

12
binutils/configure vendored
View File

@ -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)'

View File

@ -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)'

View File

@ -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. */

View File

@ -1,3 +1,10 @@
2006-08-22 Pedro Alves <pedro_alves@portugalmail.pt>
* 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 <julian@codesourcery.com>
* config/tc-arm.c (md_assemble): Improve diagnostic when attempting

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,3 +1,21 @@
2006-08-22 Pedro Alves <pedro_alves@portugalmail.pt>
* 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 <paul@codesourcery.com>
* emultempl/armelf.em (arm_elf_before_allocation): Call

View File

@ -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)"

View File

@ -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)"

View File

@ -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

View File

@ -37,15 +37,18 @@ cat >>e${EMULATION_NAME}.c <<EOF
#define TARGET_IS_${EMULATION_NAME}
/* Do this before including bfd.h, so we prototype the right functions. */
#ifdef TARGET_IS_arm_epoc_pe
#define bfd_arm_pe_allocate_interworking_sections \
bfd_arm_epoc_pe_allocate_interworking_sections
#define bfd_arm_pe_get_bfd_for_interworking \
bfd_arm_epoc_pe_get_bfd_for_interworking
#define bfd_arm_pe_process_before_allocation \
bfd_arm_epoc_pe_process_before_allocation
#endif
#if defined(TARGET_IS_armpe) \
|| defined(TARGET_IS_arm_epoc_pe) \
|| defined(TARGET_IS_arm_wince_pe)
#define bfd_arm_allocate_interworking_sections \
bfd_${EMULATION_NAME}_allocate_interworking_sections
#define bfd_arm_get_bfd_for_interworking \
bfd_${EMULATION_NAME}_get_bfd_for_interworking
#define bfd_arm_process_before_allocation \
bfd_${EMULATION_NAME}_process_before_allocation
#endif
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
@ -85,10 +88,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
#define PE_DEF_SECTION_ALIGNMENT ${OVERRIDE_SECTION_ALIGNMENT}
#endif
#if defined(TARGET_IS_i386pe)
#define DLL_SUPPORT
#endif
#if defined(TARGET_IS_shpe) || defined(TARGET_IS_mipspe) || defined(TARGET_IS_armpe)
#if defined(TARGET_IS_i386pe) \
|| defined(TARGET_IS_shpe) \
|| defined(TARGET_IS_mipspe) \
|| defined(TARGET_IS_armpe) \
|| defined(TARGET_IS_arm_epoc_pe) \
|| defined(TARGET_IS_arm_wince_pe)
#define DLL_SUPPORT
#endif
@ -99,7 +104,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
#undef PE_DEF_SECTION_ALIGNMENT
#undef PE_DEF_FILE_ALIGNMENT
#define NT_EXE_IMAGE_BASE 0x00010000
#ifdef TARGET_IS_armpe
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
#define PE_DEF_SECTION_ALIGNMENT 0x00001000
#define PE_DEF_SUBSYSTEM 9
#else
@ -139,7 +145,7 @@ gld_${EMULATION_NAME}_before_parse (void)
link_info.pei386_runtime_pseudo_reloc = -1;
#if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe
#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe || defined TARGET_IS_arm_wince_pe
lang_default_entry ("WinMainCRTStartup");
#else
lang_default_entry ("_WinMainCRTStartup");
@ -282,7 +288,7 @@ static definfo init[] =
D(MinorOperatingSystemVersion,"__minor_os_version__", 0),
D(MajorImageVersion,"__major_image_version__", 1),
D(MinorImageVersion,"__minor_image_version__", 0),
#ifdef TARGET_IS_armpe
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
D(MajorSubsystemVersion,"__major_subsystem_version__", 3),
#else
D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
@ -997,22 +1003,21 @@ gld_${EMULATION_NAME}_after_open (void)
pe_find_data_imports ();
#if ! (defined (TARGET_IS_i386pe) || defined (TARGET_IS_armpe))
if (link_info.shared)
#else
#if defined (TARGET_IS_i386pe) \
|| defined (TARGET_IS_armpe) \
|| defined (TARGET_IS_arm_epoc_pe) \
|| defined (TARGET_IS_arm_wince_pe)
if (!link_info.relocatable)
#endif
pe_dll_build_sections (output_bfd, &link_info);
#ifndef TARGET_IS_i386pe
#ifndef TARGET_IS_armpe
else
pe_exe_build_sections (output_bfd, &link_info);
#else
if (link_info.shared)
pe_dll_build_sections (output_bfd, &link_info);
#endif
#endif
#endif
#endif /* DLL_SUPPORT */
#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)
if (strstr (bfd_get_target (output_bfd), "arm") == NULL)
{
/* The arm backend needs special fields in the output hash structure.
@ -1026,7 +1031,7 @@ gld_${EMULATION_NAME}_after_open (void)
/* Find a BFD that can hold the interworking stubs. */
LANG_FOR_EACH_INPUT_STATEMENT (is)
{
if (bfd_arm_pe_get_bfd_for_interworking (is->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 ();

View File

@ -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: