This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/9] bfd: Add a new target named arm-*-mingw32


This is for targeting "normal" windows on arm, such as Windows RT
or Windows Phone 8, both which technically are "normal" windows,
in contrary to Windows CE.

This shares much code with the existing ARM_WINCE conditionals
(which mostly are generic to microsoft's PE/COFF for ARM and
not specific to windows CE). The main difference to the old
CE target is that this target uses a separate COFF magic value
(ARMV7PEMAGIC) which is documented as "ARMv7 (or higher) Thumb
mode only".

---
This doesn't update the automatically generated file bfd/configure.
---
 bfd/config.bfd                 |    6 ++++++
 bfd/configure.in               |    1 +
 bfd/pe-arm-win.c               |   43 ++++++++++++++++++++++++++++++++++++++++
 bfd/targets.c                  |    2 ++
 gas/config/tc-arm.h            |    2 ++
 gas/config/te-wince-pe-armv7.h |   21 ++++++++++++++++++++
 gas/configure.tgt              |    2 ++
 ld/configure.tgt               |    2 +-
 8 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 bfd/pe-arm-win.c
 create mode 100644 gas/config/te-wince-pe-armv7.h

diff --git a/bfd/config.bfd b/bfd/config.bfd
index 228e7c1..153f434 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -295,6 +295,12 @@ case "${targ}" in
     targ_underscore=no
     targ_cflags=-DARM_COFF_BUGFIX
     ;;
+  arm-*-mingw32)
+    targ_defvec=arm_win_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 -DARMV7_WIN -DARM_COFF_BUGFIX"
+    ;;
   arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*)
     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"
diff --git a/bfd/configure.in b/bfd/configure.in
index d9bef83..5133046 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -699,6 +699,7 @@ do
     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 " ;;
+    arm_win_pe_little_vec)	tb="$tb pe-arm-win.lo pe-arm.lo peigen.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armnetbsd_vec)		tb="$tb armnetbsd.lo aout32.lo" ;;
diff --git a/bfd/pe-arm-win.c b/bfd/pe-arm-win.c
new file mode 100644
index 0000000..b18b17e
--- /dev/null
+++ b/bfd/pe-arm-win.c
@@ -0,0 +1,43 @@
+/* BFD back-end for ARM WIN PE files.
+   Copyright 2013 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 3 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_win_pe_little_vec
+#define TARGET_LITTLE_NAME   "pe-arm-win-little"
+
+#define bfd_arm_allocate_interworking_sections \
+  bfd_arm_win_pe_allocate_interworking_sections
+#define bfd_arm_get_bfd_for_interworking \
+  bfd_arm_win_pe_get_bfd_for_interworking
+#define bfd_arm_process_before_allocation \
+  bfd_arm_win_pe_process_before_allocation
+
+#define LOCAL_LABEL_PREFIX "."
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#undef  bfd_pe_print_pdata
+#define	bfd_pe_print_pdata   _bfd_pe_print_ce_compressed_pdata
+
+#include "pe-arm.c"
+
diff --git a/bfd/targets.c b/bfd/targets.c
index c9fbbc2..195cec4 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -585,6 +585,7 @@ 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 arm_win_pe_little_vec;
 extern const bfd_target armcoff_big_vec;
 extern const bfd_target armcoff_little_vec;
 extern const bfd_target armnetbsd_vec;
@@ -958,6 +959,7 @@ static const bfd_target * const _bfd_target_vector[] =
 	&arm_wince_pe_little_vec,
 	&arm_wince_pei_big_vec,
 	&arm_wince_pei_little_vec,
+	&arm_win_pe_little_vec,
 	&armcoff_big_vec,
 	&armcoff_little_vec,
 	&armnetbsd_vec,
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index 3a0fab0..a06ba14 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -66,6 +66,8 @@ struct fix;
 # if defined TE_PE
 #  if defined TE_EPOC
 #   define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little")
+#  elif defined TE_WIN_ARMV7
+#   define TARGET_FORMAT (target_big_endian ? "pe-arm-win-big" : "pe-arm-win-little")
 #  elif defined TE_WINCE
 #   define TARGET_FORMAT (target_big_endian ? "pe-arm-wince-big" : "pe-arm-wince-little")
 #  else
diff --git a/gas/config/te-wince-pe-armv7.h b/gas/config/te-wince-pe-armv7.h
new file mode 100644
index 0000000..ef93fd0
--- /dev/null
+++ b/gas/config/te-wince-pe-armv7.h
@@ -0,0 +1,21 @@
+/* Copyright 2013 Free Software Foundation, Inc.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS 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 3,
+   or (at your option) any later version.
+
+   GAS 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 GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#define TE_WIN_ARMV7
+#include "te-wince-pe.h"
diff --git a/gas/configure.tgt b/gas/configure.tgt
index da6f65a..56df9b1 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -148,6 +148,8 @@ case ${generic_target} in
   arm-epoc-pe)				fmt=coff em=epoc-pe ;;
   arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*)
 					fmt=coff em=wince-pe ;;
+  arm-*-mingw32)
+					fmt=coff em=wince-pe-armv7 ;;
   arm-*-pe)				fmt=coff em=pe ;;
   arm-*-riscix*)			fmt=aout em=riscix ;;
 
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 65884fa..8855c78 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -73,7 +73,7 @@ arc-*-elf*)		targ_emul=arcelf
 arm-epoc-pe)		targ_emul=arm_epoc_pe ;	targ_extra_ofiles="deffilep.o pe-dll.o" ;;
 arm*-*-cegcc*)		targ_emul=arm_wince_pe ; targ_extra_ofiles="deffilep.o pe-dll.o"
 			LIB_PATH='${tooldir}/lib/w32api' ;;
-arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*)
+arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm-*-mingw32)
 			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 ;;
-- 
1.7.9.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]