This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Properly split arm-pe / arm-wince-pe.
- From: Pedro Alves <pedro_alves at portugalmail dot pt>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 09 Aug 2006 21:40:41 +0100
- Subject: [PATCH] Properly split arm-pe / arm-wince-pe.
- References: <44AA6CE1.8070708@portugalmail.pt> <20060705004409.GA31620@nevyn.them.org> <44D8606F.1040903@portugalmail.pt> <44D861C5.5040408@redhat.com>
Nick Clifton wrote:
Pedro Alves wrote:
[target] [bfd image format]
arm-pe pei-arm-little
arm-epoc-pe epoc-pei-arm-little
arm-wince-pe pei-arm-little
If I am correct, then problem is that arm-pe and arm-wince-pe use the
same bfd format names, but they aren't really the same.
The reloc id numbers are different, and wince doesn't use underscores
while arm-pe does, among other differences.
Should I rename wince's bfd format? wince-pei-arm-little? Then, I would
just add a new entry to pe_detail_list[] with the correct values.
Yes, this would be a very good idea.
I started modeling the change after "epoc-pei-arm-little". That is,
I introduced the "wince-pei-arm-little" bfd format.
But while debugging it, I stumbled on a few things breaking. It turned
out that in some places, the bfd name is assumed to start with
"pe-" or "pei-".
ex:
bfd/libpei.h:
/* Macro: Returns true if the bfd is a PE executable as opposed to a PE
object file. */
#define bfd_pe_executable_p(abfd) \
(strncmp ((abfd)->xvec->name, "pei-", 4) == 0 \
|| strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0)
These are places that easily brake with the introduction of these bfd
subformats. In fact "epoc-pei-arm-little" might be broken for this
reason. Also I saw on the archives that efi-app-* was once broken
because of this.
I don't now if there is a naming convention for these things,
and since there is at least one flavour-machine-os precedent
("elf32-shl-symbian"), I switched to "pei-arm-wince-little".
(Although not being a triplet feels weird. Maybe "pei-arml-wince" would
be better? Anyway this is probably not so important...)
(If desired, I can provide a patch to s/epoc-pei-arm-/pei-arm-epoc-/g)
Pedro Alves
---
bfd/ChangeLog
2006-08-09 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.
* 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 has now its own new vector.
Adjust.
* config.bfd: Likewise.
* configure.in: Likewise.
* configure: Regenerate.
* pe-arm-wince.c: New file.
* pei-arm-wince.c: New file.
* pe-arm.c: Remove ARM_WINCE block.
* pei-arm.c: Likewise.
---
binutils/ChangeLog
2006-08-09 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.
---
gas/ChangeLog
2006-08-09 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.
---
ld/ChangeLog
2006-08-09 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 [PE_ARCH_arm_wince]: Define.
(pe_detail_list): Add arm-wince case.
* emultempl/pe.em: Handle new TARGET_IS_arm_wince_pe define.
(gld_${EMULATION_NAME}_recognized_file): Handle new arm-wince
bfd format name.
---
--- /dev/null 2006-08-09 21:30:02.984825600 +0100
+++ bfd/pe-arm-wince.c 2006-08-09 00:56:10.000000000 +0100
@@ -0,0 +1,28 @@
+/* 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"
+
+#include "pe-arm.c"
--- /dev/null 2006-08-09 21:30:13.469902400 +0100
+++ bfd/pei-arm-wince.c 2006-08-09 00:56:30.000000000 +0100
@@ -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"
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.179
diff -p -u -r1.179 Makefile.am
--- bfd/Makefile.am 4 Aug 2006 13:13:55 -0000 1.179
+++ bfd/Makefile.am 9 Aug 2006 20:16:03 -0000
@@ -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)/filename
$(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 \
Index: bfd/Makefile.in
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.in,v
retrieving revision 1.195
diff -p -u -r1.195 Makefile.in
--- bfd/Makefile.in 4 Aug 2006 13:13:56 -0000 1.195
+++ bfd/Makefile.in 9 Aug 2006 20:16:09 -0000
@@ -38,6 +38,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+LIBOBJDIR =
DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \
ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
@@ -555,6 +556,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 +730,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 +2188,16 @@ pei-arm.lo: pei-arm.c $(INCDIR)/filename
$(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 \
Index: bfd/bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.86
diff -p -u -r1.86 bfd.c
--- bfd/bfd.c 6 Aug 2006 15:04:17 -0000 1.86
+++ bfd/bfd.c 9 Aug 2006 20:16:26 -0000
@@ -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);
Index: bfd/coff-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-arm.c,v
retrieving revision 1.67
diff -p -u -r1.67 coff-arm.c
--- bfd/coff-arm.c 7 Aug 2006 10:26:08 -0000 1.67
+++ bfd/coff-arm.c 9 Aug 2006 20:16:34 -0000
@@ -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
Index: bfd/config.bfd
===================================================================
RCS file: /cvs/src/src/bfd/config.bfd,v
retrieving revision 1.211
diff -p -u -r1.211 config.bfd
--- bfd/config.bfd 4 Aug 2006 13:13:55 -0000 1.211
+++ bfd/config.bfd 9 Aug 2006 20:16:37 -0000
@@ -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"
;;
Index: bfd/configure
===================================================================
RCS file: /cvs/src/src/bfd/configure,v
retrieving revision 1.241
diff -p -u -r1.241 configure
--- bfd/configure 7 Aug 2006 11:04:37 -0000 1.241
+++ bfd/configure 9 Aug 2006 20:17:16 -0000
@@ -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" ;;
@@ -12343,9 +12347,10 @@ for ac_i in : $LIBOBJS; do test "x$ac_i"
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.211
diff -p -u -r1.211 configure.in
--- bfd/configure.in 7 Aug 2006 11:04:37 -0000 1.211
+++ bfd/configure.in 9 Aug 2006 20:17:21 -0000
@@ -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" ;;
Index: bfd/pe-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/pe-arm.c,v
retrieving revision 1.10
diff -p -u -r1.10 pe-arm.c
--- bfd/pe-arm.c 6 Aug 2006 15:04:17 -0000 1.10
+++ bfd/pe-arm.c 9 Aug 2006 20:17:22 -0000
@@ -40,10 +40,6 @@ Foundation, Inc., 51 Franklin Street - F
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 }, \
Index: bfd/pei-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/pei-arm.c,v
retrieving revision 1.10
diff -p -u -r1.10 pei-arm.c
--- bfd/pei-arm.c 6 Aug 2006 15:04:17 -0000 1.10
+++ bfd/pei-arm.c 9 Aug 2006 20:17:31 -0000
@@ -32,10 +32,6 @@ Foundation, Inc., 51 Franklin Street - F
#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 }, \
Index: bfd/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.149
diff -p -u -r1.149 targets.c
--- bfd/targets.c 4 Aug 2006 13:13:56 -0000 1.149
+++ bfd/targets.c 9 Aug 2006 20:17:37 -0000
@@ -541,6 +541,10 @@ extern const bfd_target arm_epoc_pe_big_
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_tar
&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,
Index: binutils/configure
===================================================================
RCS file: /cvs/src/src/binutils/configure,v
retrieving revision 1.82
diff -p -u -r1.82 configure
--- binutils/configure 31 May 2006 15:14:35 -0000 1.82
+++ binutils/configure 9 Aug 2006 20:18:19 -0000
@@ -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)'
@@ -8623,9 +8629,10 @@ for ac_i in : $LIBOBJS; do test "x$ac_i"
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
Index: binutils/configure.in
===================================================================
RCS file: /cvs/src/src/binutils/configure.in,v
retrieving revision 1.62
diff -p -u -r1.62 configure.in
--- binutils/configure.in 31 May 2006 15:14:35 -0000 1.62
+++ binutils/configure.in 9 Aug 2006 20:18:19 -0000
@@ -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)'
Index: binutils/dlltool.c
===================================================================
RCS file: /cvs/src/src/binutils/dlltool.c,v
retrieving revision 1.69
diff -p -u -r1.69 dlltool.c
--- binutils/dlltool.c 9 Mar 2006 21:50:53 -0000 1.69
+++ binutils/dlltool.c 9 Aug 2006 20:18:26 -0000
@@ -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 *nam
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. */
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.135
diff -p -u -r1.135 Makefile.am
--- gas/Makefile.am 8 Jun 2006 05:09:37 -0000 1.135
+++ gas/Makefile.am 9 Aug 2006 20:18:47 -0000
@@ -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
Index: gas/Makefile.in
===================================================================
RCS file: /cvs/src/src/gas/Makefile.in,v
retrieving revision 1.147
diff -p -u -r1.147 Makefile.in
--- gas/Makefile.in 8 Jun 2006 05:09:37 -0000 1.147
+++ gas/Makefile.in 9 Aug 2006 20:18:56 -0000
@@ -38,6 +38,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+LIBOBJDIR =
noinst_PROGRAMS = as-new$(EXEEXT)
EXTRA_PROGRAMS = itbl-test$(EXEEXT)
DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
@@ -608,7 +609,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
Index: gas/config/tc-arm.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.h,v
retrieving revision 1.39
diff -p -u -r1.39 tc-arm.h
--- gas/config/tc-arm.h 6 Aug 2006 15:04:23 -0000 1.39
+++ gas/config/tc-arm.h 9 Aug 2006 20:19:34 -0000
@@ -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
Index: gas/doc/Makefile.in
===================================================================
RCS file: /cvs/src/src/gas/doc/Makefile.in,v
retrieving revision 1.81
diff -p -u -r1.81 Makefile.in
--- gas/doc/Makefile.in 8 Jun 2006 05:09:37 -0000 1.81
+++ gas/doc/Makefile.in 9 Aug 2006 20:19:38 -0000
@@ -36,6 +36,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+LIBOBJDIR =
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.217
diff -p -u -r1.217 Makefile.am
--- ld/Makefile.am 4 Aug 2006 13:13:56 -0000 1.217
+++ ld/Makefile.am 9 Aug 2006 20:20:19 -0000
@@ -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.s
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)"
Index: ld/Makefile.in
===================================================================
RCS file: /cvs/src/src/ld/Makefile.in,v
retrieving revision 1.231
diff -p -u -r1.231 Makefile.in
--- ld/Makefile.in 4 Aug 2006 13:13:56 -0000 1.231
+++ ld/Makefile.in 9 Aug 2006 20:20:38 -0000
@@ -37,6 +37,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+LIBOBJDIR =
noinst_PROGRAMS = ld-new$(EXEEXT)
DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
@@ -332,6 +333,7 @@ ALL_EMULATIONS = \
ealpha.o \
earcelf.o \
earm_epoc_pe.o \
+ earm_wince_pe.o \
earmaoutb.o \
earmaoutl.o \
earmcoff.o \
@@ -1380,6 +1382,9 @@ earmnto.c: $(srcdir)/emulparams/armnto.s
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)"
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.191
diff -p -u -r1.191 configure.tgt
--- ld/configure.tgt 4 Aug 2006 13:13:56 -0000 1.191
+++ ld/configure.tgt 9 Aug 2006 20:21:19 -0000
@@ -37,7 +37,8 @@ alpha*-*-openbsd*) targ_emul=elf64alpha
arc-*-elf*) targ_emul=arcelf
;;
arm-epoc-pe) targ_emul=arm_epoc_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-arm-*-wince) targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+arm-wince-pe) targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
+arm-*-wince) targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arm-*-pe) targ_emul=armpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
armeb-*-aout) targ_emul=armaoutb ;;
Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.85
diff -p -u -r1.85 pe-dll.c
--- ld/pe-dll.c 23 Jun 2006 11:20:15 -0000 1.85
+++ ld/pe-dll.c 9 Aug 2006 20:21:25 -0000
@@ -207,6 +207,7 @@ static autofilter_entry_type autofilter_
#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 coff-arm.c */,
+ PE_ARCH_arm_wince,
+ bfd_arch_arm,
+ FALSE,
+ autofilter_symbollist_generic
+ },
{ NULL, NULL, 0, 0, 0, FALSE, NULL }
};
Index: ld/emultempl/pe.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/pe.em,v
retrieving revision 1.118
diff -p -u -r1.118 pe.em
--- ld/emultempl/pe.em 27 Jun 2006 11:45:21 -0000 1.118
+++ ld/emultempl/pe.em 9 Aug 2006 20:21:33 -0000
@@ -85,10 +85,11 @@ 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_wince_pe)
#define DLL_SUPPORT
#endif
@@ -99,7 +100,7 @@ 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
@@ -282,7 +283,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,7 +998,7 @@ gld_${EMULATION_NAME}_after_open (void)
pe_find_data_imports ();
-#if ! (defined (TARGET_IS_i386pe) || defined (TARGET_IS_armpe))
+#if ! (defined (TARGET_IS_i386pe) || defined (TARGET_IS_armpe) || defined (TARGET_IS_arm_wince_pe))
if (link_info.shared)
#else
if (!link_info.relocatable)
@@ -1006,13 +1007,15 @@ gld_${EMULATION_NAME}_after_open (void)
#ifndef TARGET_IS_i386pe
#ifndef TARGET_IS_armpe
+#ifndef TARGET_IS_arm_wince_pe
else
pe_exe_build_sections (output_bfd, &link_info);
#endif
#endif
#endif
+#endif
-#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.
@@ -1267,7 +1270,7 @@ gld_${EMULATION_NAME}_before_allocation
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.
@@ -1289,7 +1292,7 @@ gld_${EMULATION_NAME}_before_allocation
/* We have seen it all. Allocate it, and carry on. */
bfd_arm_pe_allocate_interworking_sections (& link_info);
-#endif /* TARGET_IS_armpe */
+#endif /* TARGET_IS_armpe || TARGET_IS_arm_epoc_pe || TARGET_IS_arm_wince_pe */
before_allocation_default ();
}
@@ -1404,6 +1407,9 @@ gld_${EMULATION_NAME}_recognized_file (l
#ifdef TARGET_IS_armpe
pe_dll_id_target ("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)
{
char fbuf[LD_PATHMAX + 1];
@@ -1424,7 +1430,7 @@ gld_${EMULATION_NAME}_recognized_file (l
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 +1470,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 ();