public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] : Correct ARM_RVA32 value in pe images generation for arm  Windows CE.
@ 2006-07-04 13:28 Pedro Alves
  2006-07-05  0:44 ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2006-07-04 13:28 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

Hi all,

Please find attached a patch against ld/pe-dll.c that fixes pei .reloc 
section generation for arm Windows CE targets.

The problem was that the wrong ARM_RVA32 value was filled in the
pe_details->imagebase_reloc for ARM targets.

The PE Coff specification states:
	Constant - IMAGE_REL_ARM_ADDR32NB
	Value - 0x0002
	Description  - The 32-bit RVA of the target.

And indeed the correct values are defined in bfd/coff-arm.c:

#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
#endif

And for all other coff arm targets:
#define ARM_RVA32   11

But since those defines are not in a header, the pe-dll.c value
bitrotted.

This is one of those bugs that makes you hate magic constants to
the gut ;)

I have caught this while fixing --enable-runtime-pseudo-reloc for
arm-wince-pe, so I am quite sure it works correctly for that target.

The PE_ARCH_arm_epoc I am not sure, but it I guess the
reloc values should come from the PE COFF specification too.

Can anyone point me to a list of which platforms use arm-pe?
What is this epoc arm target used for?

Cheers,
Pedro Alves

---
2006-07-04  Pedro Alves <pedro_alves@portugalmail.pt>

	* pe-dll.c (pe_detail_list): Use correct ARM_RVA32 value for
PE_ARCH_arm, and PE_ARCH_arm_epoc cases.


[-- Attachment #2: ld-rva.diff --]
[-- Type: text/plain, Size: 650 bytes --]

--- ld/pe-dll.c.org	2006-07-04 13:55:54.000000000 +0100
+++ ld/pe-dll.c	2006-07-04 14:04:20.000000000 +0100
@@ -240,7 +240,7 @@ static pe_details_type pe_detail_list[] 
   {
     "pei-arm-little",
     "pe-arm-little",
-    11 /* ARM_RVA32 */,
+    2 /* ARM_RVA32, or IMAGE_REL_ARM_ADDR32NB in PE & COFF specification.  */
     PE_ARCH_arm,
     bfd_arch_arm,
     TRUE,
@@ -249,7 +249,7 @@ static pe_details_type pe_detail_list[] 
   {
     "epoc-pei-arm-little",
     "epoc-pe-arm-little",
-    11 /* ARM_RVA32 */,
+    2 /* ARM_RVA32, or IMAGE_REL_ARM_ADDR32NB in PE & COFF specification.  */
     PE_ARCH_arm_epoc,
     bfd_arch_arm,
     FALSE,

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] : Correct ARM_RVA32 value in pe images generation for arm  Windows CE.
  2006-07-04 13:28 [PATCH] : Correct ARM_RVA32 value in pe images generation for arm Windows CE Pedro Alves
@ 2006-07-05  0:44 ` Daniel Jacobowitz
  2006-08-08  9:58   ` Pedro Alves
  2006-08-08  9:59   ` Pedro Alves
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2006-07-05  0:44 UTC (permalink / raw)
  To: Pedro Alves; +Cc: binutils

On Tue, Jul 04, 2006 at 02:28:01PM +0100, Pedro Alves wrote:
> Can anyone point me to a list of which platforms use arm-pe?
> What is this epoc arm target used for?

I don't know for sure, but the only EPOC I'm familiar with is the image
format used for SymbianOS.  However, I'm pretty sure that the binutils
support won't work for current versions of that platform anyway.  I
don't know whether anyone uses it for the older releases.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] : Correct ARM_RVA32 value in pe images generation for  arm  Windows CE.
  2006-07-05  0:44 ` Daniel Jacobowitz
@ 2006-08-08  9:58   ` Pedro Alves
  2006-08-08  9:59   ` Pedro Alves
  1 sibling, 0 replies; 13+ messages in thread
From: Pedro Alves @ 2006-08-08  9:58 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils, nickc

Daniel Jacobowitz wrote:
> On Tue, Jul 04, 2006 at 02:28:01PM +0100, Pedro Alves wrote:
> 
>>Can anyone point me to a list of which platforms use arm-pe?
>>What is this epoc arm target used for?
> 
> 
> I don't know for sure, but the only EPOC I'm familiar with is the image
> format used for SymbianOS.  However, I'm pretty sure that the binutils
> support won't work for current versions of that platform anyway.  I
> don't know whether anyone uses it for the older releases.
> 

Thanks for the info.
So, I guess there is arm-pe, and arm-epoc-pe, both
supporting Symbian targets (different SDK versions??),
and then there is arm-wince-pe, for ARM based Windows CE devices.

[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.

Cheers,
Pedro Alves.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] : Correct ARM_RVA32 value in pe images generation for  arm  Windows CE.
  2006-07-05  0:44 ` Daniel Jacobowitz
  2006-08-08  9:58   ` Pedro Alves
@ 2006-08-08  9:59   ` Pedro Alves
  2006-08-08 10:05     ` Nick Clifton
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2006-08-08  9:59 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils, nickc

Daniel Jacobowitz wrote:
> On Tue, Jul 04, 2006 at 02:28:01PM +0100, Pedro Alves wrote:
> 
>>Can anyone point me to a list of which platforms use arm-pe?
>>What is this epoc arm target used for?
> 
> 
> I don't know for sure, but the only EPOC I'm familiar with is the image
> format used for SymbianOS.  However, I'm pretty sure that the binutils
> support won't work for current versions of that platform anyway.  I
> don't know whether anyone uses it for the older releases.
> 

Thanks for the info.
So, I guess there is arm-pe, and arm-epoc-pe, both
supporting Symbian targets (different SDK versions??),
and then there is arm-wince-pe, for ARM based Windows CE devices.

[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.

Cheers,
Pedro Alves.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] : Correct ARM_RVA32 value in pe images generation for  arm  Windows CE.
  2006-08-08  9:59   ` Pedro Alves
@ 2006-08-08 10:05     ` Nick Clifton
  2006-08-09 20:55       ` [PATCH] Properly split arm-pe / arm-wince-pe Pedro Alves
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Clifton @ 2006-08-08 10:05 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Daniel Jacobowitz, binutils

Hi Pedro,

>>> Can anyone point me to a list of which platforms use arm-pe?
>>> What is this epoc arm target used for?

>> I don't know for sure, but the only EPOC I'm familiar with is the image
>> format used for SymbianOS. 

The arm-epoc-pe target was for the SymbianOS.  The epoc qualifier was added
to distinguish it from the WinCE targeted PE format version.  Ideally arm-pe
should have been dropped, but it never was.

> So, I guess there is arm-pe, and arm-epoc-pe, both
> supporting Symbian targets (different SDK versions??),

By now the answer is probably yes.  At the time the arm-epoc-pe target 
was introduced, the answer was no.

> [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.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] Properly split arm-pe / arm-wince-pe.
  2006-08-08 10:05     ` Nick Clifton
@ 2006-08-09 20:55       ` Pedro Alves
  2006-08-11 13:57         ` Pedro Alves
  2006-08-16  8:30         ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2) Pedro Alves
  0 siblings, 2 replies; 13+ messages in thread
From: Pedro Alves @ 2006-08-09 20:55 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 3383 bytes --]

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.

---

[-- Attachment #2: binutils.diff --]
[-- Type: text/plain, Size: 29110 bytes --]

--- /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 ();
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe.
  2006-08-09 20:55       ` [PATCH] Properly split arm-pe / arm-wince-pe Pedro Alves
@ 2006-08-11 13:57         ` Pedro Alves
  2006-08-11 14:04           ` Nick Clifton
  2006-08-16  8:30         ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2) Pedro Alves
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2006-08-11 13:57 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Nick Clifton, binutils

Humm, just noticed the patch is not complete.
I'll work on updating it and send an updated patch later.
Sorry for the noise.

Cheers,
Pedro Alves

P.S.

I notice that arm-epoc-pe is broken in dll generation.
Was dll support disabled for it on purpose, or was it an oversight?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe.
  2006-08-11 13:57         ` Pedro Alves
@ 2006-08-11 14:04           ` Nick Clifton
  0 siblings, 0 replies; 13+ messages in thread
From: Nick Clifton @ 2006-08-11 14:04 UTC (permalink / raw)
  To: Pedro Alves; +Cc: binutils

Hi Pedro,

> I notice that arm-epoc-pe is broken in dll generation.
> Was dll support disabled for it on purpose, or was it an oversight?

It is an oversight.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe. (take 2)
  2006-08-09 20:55       ` [PATCH] Properly split arm-pe / arm-wince-pe Pedro Alves
  2006-08-11 13:57         ` Pedro Alves
@ 2006-08-16  8:30         ` Pedro Alves
  2006-08-21  8:53           ` Nick Clifton
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2006-08-16  8:30 UTC (permalink / raw)
  To: binutils; +Cc: Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]

Hi all,

Pedro Alves wrote:
> Nick Clifton wrote:
>>
>> Pedro Alves wrote:
>>>
>>> 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.
>>
 >Humm, just noticed the patch is not complete.
 >I'll work on updating it and send an updated patch later.
 >I notice that arm-epoc-pe is broken in dll generation.

Here is take 2 of the same patch. It adds a few missing things I missed
on the previous patch. Additionally, it adds DLL_SUPPORT to arm-epoc-pe.
I've also removed the regenerated files from the patch. Let me know if
you need them.

Tested on arm-wince-pe, arm-pe, arm-epoc-pe and i686-pe-cygwin.

Please review and commit.

Cheers,
Pedro Alves

---

bfd/ChangeLog

2006-08-15  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.

---

binutils/ChangeLog

2006-08-15  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-15  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-15  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.


[-- Attachment #2: binutils-wincesplit.diff --]
[-- Type: text/plain, Size: 25916 bytes --]

diff -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/Makefile.am binutils-cvs_wincesplit/bfd/Makefile.am
--- binutils-cvs_pristine/bfd/Makefile.am	2006-08-04 14:13:56.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/Makefile.am	2006-08-15 10:57:12.000000000 +0100
@@ -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 \
diff -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/bfd.c binutils-cvs_wincesplit/bfd/bfd.c
--- binutils-cvs_pristine/bfd/bfd.c	2006-08-06 16:04:18.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/bfd.c	2006-08-15 10:57:12.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/coff-arm.c binutils-cvs_wincesplit/bfd/coff-arm.c
--- binutils-cvs_pristine/bfd/coff-arm.c	2006-08-07 11:26:08.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/coff-arm.c	2006-08-15 10:57:12.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/config.bfd binutils-cvs_wincesplit/bfd/config.bfd
--- binutils-cvs_pristine/bfd/config.bfd	2006-08-04 14:13:56.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/config.bfd	2006-08-15 10:57:12.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/configure.in binutils-cvs_wincesplit/bfd/configure.in
--- binutils-cvs_pristine/bfd/configure.in	2006-08-07 12:04:38.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/configure.in	2006-08-15 16:34:18.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/pe-arm-wince.c binutils-cvs_wincesplit/bfd/pe-arm-wince.c
--- binutils-cvs_pristine/bfd/pe-arm-wince.c	1970-01-01 00:00:00.000000000 +0000
+++ binutils-cvs_wincesplit/bfd/pe-arm-wince.c	2006-08-14 19:13:04.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/pe-arm.c binutils-cvs_wincesplit/bfd/pe-arm.c
--- binutils-cvs_pristine/bfd/pe-arm.c	2006-08-06 16:04:18.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/pe-arm.c	2006-08-15 10:57:12.000000000 +0100
@@ -17,6 +17,17 @@ You should have received a copy of the G
 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 - F
 #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 -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/pei-arm-wince.c binutils-cvs_wincesplit/bfd/pei-arm-wince.c
--- binutils-cvs_pristine/bfd/pei-arm-wince.c	1970-01-01 00:00:00.000000000 +0000
+++ binutils-cvs_wincesplit/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"
diff -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/pei-arm.c binutils-cvs_wincesplit/bfd/pei-arm.c
--- binutils-cvs_pristine/bfd/pei-arm.c	2006-08-06 16:04:18.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/pei-arm.c	2006-08-15 10:57:12.000000000 +0100
@@ -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 }, \
diff -x CVS -x doc -Nurp binutils-cvs_pristine/bfd/targets.c binutils-cvs_wincesplit/bfd/targets.c
--- binutils-cvs_pristine/bfd/targets.c	2006-08-04 14:13:56.000000000 +0100
+++ binutils-cvs_wincesplit/bfd/targets.c	2006-08-15 10:57:12.000000000 +0100
@@ -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,
diff -x CVS -x doc -Nurp binutils-cvs_pristine/binutils/configure.in binutils-cvs_wincesplit/binutils/configure.in
--- binutils-cvs_pristine/binutils/configure.in	2006-05-31 16:14:36.000000000 +0100
+++ binutils-cvs_wincesplit/binutils/configure.in	2006-08-15 10:57:12.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/binutils/dlltool.c binutils-cvs_wincesplit/binutils/dlltool.c
--- binutils-cvs_pristine/binutils/dlltool.c	2006-03-09 21:50:54.000000000 +0000
+++ binutils-cvs_wincesplit/binutils/dlltool.c	2006-08-15 10:57:12.000000000 +0100
@@ -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. */
diff -x CVS -x doc -Nurp binutils-cvs_pristine/gas/Makefile.am binutils-cvs_wincesplit/gas/Makefile.am
--- binutils-cvs_pristine/gas/Makefile.am	2006-06-08 06:09:38.000000000 +0100
+++ binutils-cvs_wincesplit/gas/Makefile.am	2006-08-15 10:57:12.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/gas/config/tc-arm.h binutils-cvs_wincesplit/gas/config/tc-arm.h
--- binutils-cvs_pristine/gas/config/tc-arm.h	2006-08-06 16:04:24.000000000 +0100
+++ binutils-cvs_wincesplit/gas/config/tc-arm.h	2006-08-15 10:57:12.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/ld/Makefile.am binutils-cvs_wincesplit/ld/Makefile.am
--- binutils-cvs_pristine/ld/Makefile.am	2006-08-04 14:13:56.000000000 +0100
+++ binutils-cvs_wincesplit/ld/Makefile.am	2006-08-15 10:57:12.000000000 +0100
@@ -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)"
diff -x CVS -x doc -Nurp binutils-cvs_pristine/ld/configure.tgt binutils-cvs_wincesplit/ld/configure.tgt
--- binutils-cvs_pristine/ld/configure.tgt	2006-08-04 14:13:56.000000000 +0100
+++ binutils-cvs_wincesplit/ld/configure.tgt	2006-08-15 10:57:12.000000000 +0100
@@ -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 | 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 ;;
diff -x CVS -x doc -Nurp binutils-cvs_pristine/ld/emulparams/arm_wince_pe.sh binutils-cvs_wincesplit/ld/emulparams/arm_wince_pe.sh
--- binutils-cvs_pristine/ld/emulparams/arm_wince_pe.sh	1970-01-01 00:00:00.000000000 +0000
+++ binutils-cvs_wincesplit/ld/emulparams/arm_wince_pe.sh	2006-08-15 12:22:30.000000000 +0100
@@ -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 -x CVS -x doc -Nurp binutils-cvs_pristine/ld/emultempl/pe.em binutils-cvs_wincesplit/ld/emultempl/pe.em
--- binutils-cvs_pristine/ld/emultempl/pe.em	2006-06-27 12:45:22.000000000 +0100
+++ binutils-cvs_wincesplit/ld/emultempl/pe.em	2006-08-15 12:55:52.000000000 +0100
@@ -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 
   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 
   {
     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 
   }
 
   /* 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 ();
 }
@@ -1404,6 +1409,12 @@ gld_${EMULATION_NAME}_recognized_file (l
 #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)
     {
       char fbuf[LD_PATHMAX + 1];
@@ -1424,7 +1435,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 +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 -x CVS -x doc -Nurp binutils-cvs_pristine/ld/pe-dll.c binutils-cvs_wincesplit/ld/pe-dll.c
--- binutils-cvs_pristine/ld/pe-dll.c	2006-06-23 12:20:16.000000000 +0100
+++ binutils-cvs_wincesplit/ld/pe-dll.c	2006-08-15 12:42:16.000000000 +0100
@@ -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 bfd/coff-arm.c.  */
+    PE_ARCH_arm_wince,
+    bfd_arch_arm,
+    FALSE,
+    autofilter_symbollist_generic
+  },
   { NULL, NULL, 0, 0, 0, FALSE, NULL }
 };
 
@@ -1843,6 +1853,8 @@ make_one (def_file_export *exp, bfd *par
       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;
@@ -1920,6 +1932,8 @@ make_one (def_file_export *exp, bfd *par
 	  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:

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe. (take 2)
  2006-08-16  8:30         ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2) Pedro Alves
@ 2006-08-21  8:53           ` Nick Clifton
  2006-08-21 10:47             ` Pedro Alves
  2006-08-22  0:50             ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2.1) Pedro Alves
  0 siblings, 2 replies; 13+ messages in thread
From: Nick Clifton @ 2006-08-21  8:53 UTC (permalink / raw)
  To: Pedro Alves; +Cc: binutils

Hi Pedro,

> bfd/ChangeLog
> 
> 2006-08-15  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.
> 
> ---
> 
> binutils/ChangeLog
> 
> 2006-08-15  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-15  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-15  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.

Approved and applied.  Thanks for doing this!

Cheers
   Nick

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe. (take 2)
  2006-08-21  8:53           ` Nick Clifton
@ 2006-08-21 10:47             ` Pedro Alves
  2006-08-22  0:50             ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2.1) Pedro Alves
  1 sibling, 0 replies; 13+ messages in thread
From: Pedro Alves @ 2006-08-21 10:47 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

Nick Clifton wrote:
> 
> Approved and applied.  Thanks for doing this!
> 

Thank you!

Cheers,
Pedro Alves

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe. (take 2.1)
  2006-08-21  8:53           ` Nick Clifton
  2006-08-21 10:47             ` Pedro Alves
@ 2006-08-22  0:50             ` Pedro Alves
  2006-08-22 12:26               ` Nick Clifton
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2006-08-22  0:50 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Nick Clifton wrote:
>>
>> ld/ChangeLog
>>
>> 2006-08-15  Pedro Alves  <pedro_alves@portugalmail.pt>
>>

(...)

>>     * configure.tgt: Set targ_emul to arm_wince_pe for ARM Windows
>>     CE targets.
> 

(...)

> Approved and applied.  Thanks for doing this!
> 

Looks like the above part of the patch went for a ride
into nowhere land :)

Here it goes again. Please re-review, and commit.

Cheers,
Pedro Alves

---


  ld/ChangeLog

  2006-08-21  Pedro Alves  <pedro_alves@portugalmail.pt>

      * configure.tgt: Set targ_emul to arm_wince_pe for ARM
      Windows CE targets.


[-- Attachment #2: configure.tgt.diff --]
[-- Type: text/plain, Size: 797 bytes --]

Index: configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.191
diff -u -p -r1.191 configure.tgt
--- configure.tgt	4 Aug 2006 13:13:56 -0000	1.191
+++ configure.tgt	21 Aug 2006 22:50:02 -0000
@@ -37,7 +37,7 @@ 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 | 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 ;;

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Properly split arm-pe / arm-wince-pe. (take 2.1)
  2006-08-22  0:50             ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2.1) Pedro Alves
@ 2006-08-22 12:26               ` Nick Clifton
  0 siblings, 0 replies; 13+ messages in thread
From: Nick Clifton @ 2006-08-22 12:26 UTC (permalink / raw)
  To: Pedro Alves; +Cc: binutils

Hi Pedro,

> Looks like the above part of the patch went for a ride
> into nowhere land :)

oops!

> Here it goes again. Please re-review, and commit.

>  ld/ChangeLog
>  2006-08-21  Pedro Alves  <pedro_alves@portugalmail.pt>
> 
>      * configure.tgt: Set targ_emul to arm_wince_pe for ARM
>      Windows CE targets.

Approved and applied.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-08-22 11:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-04 13:28 [PATCH] : Correct ARM_RVA32 value in pe images generation for arm Windows CE Pedro Alves
2006-07-05  0:44 ` Daniel Jacobowitz
2006-08-08  9:58   ` Pedro Alves
2006-08-08  9:59   ` Pedro Alves
2006-08-08 10:05     ` Nick Clifton
2006-08-09 20:55       ` [PATCH] Properly split arm-pe / arm-wince-pe Pedro Alves
2006-08-11 13:57         ` Pedro Alves
2006-08-11 14:04           ` Nick Clifton
2006-08-16  8:30         ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2) Pedro Alves
2006-08-21  8:53           ` Nick Clifton
2006-08-21 10:47             ` Pedro Alves
2006-08-22  0:50             ` [PATCH] Properly split arm-pe / arm-wince-pe. (take 2.1) Pedro Alves
2006-08-22 12:26               ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).