aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-09-20 11:35:11 +0000
committerNick Clifton <nickc@redhat.com>2006-09-20 11:35:11 +0000
commit99ad839030c1177eb409a99320fa7e60226f0db3 (patch)
tree31841958e04c69ceb1aeafcf7cdef5e721d23829 /binutils
parenta8bbe5b03e6b16a41a69e570061e34014d30431a (diff)
downloadgdb-99ad839030c1177eb409a99320fa7e60226f0db3.zip
gdb-99ad839030c1177eb409a99320fa7e60226f0db3.tar.gz
gdb-99ad839030c1177eb409a99320fa7e60226f0db3.tar.bz2
Add x86_64-mingw64 target
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog13
-rwxr-xr-xbinutils/configure6
-rw-r--r--binutils/configure.in8
-rw-r--r--binutils/dlltool.c97
-rw-r--r--binutils/testsuite/ChangeLog10
-rw-r--r--binutils/testsuite/binutils-all/copy-3.d2
-rw-r--r--binutils/testsuite/binutils-all/dlltool.exp7
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp4
-rw-r--r--binutils/testsuite/binutils-all/windres/lang.rc1
-rw-r--r--binutils/testsuite/binutils-all/windres/strtab1.rc1
-rw-r--r--binutils/testsuite/binutils-all/windres/windres.exp7
-rw-r--r--binutils/testsuite/lib/utils-lib.exp4
12 files changed, 139 insertions, 21 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cadf2b8..9595d92 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,16 @@
+2006-09-20 Kai Tietz <Kai.Tietz@onevision.com>
+
+ * configure.in: Add new target x86_64-pc-mingw64.
+ * configure: Regenerate.
+ * dlltool.c: Adjust include for this target.
+ (DLLTOOL_MX86_64): Added macro to handle target specific code.
+ (mname): Added default target static as "i386:x86-64".
+ (MX86): Added macro for target ident.
+ (mtable): Added target specific definitions.
+ (rvaafter): Add handling of MX86.
+ (rvabefore): Add handling of MX86.
+ (asmprefix): Add handling of MX86.
+
2006-09-17 Mei Ligang <ligang@sunnorth.com.cn>
* readelf.c: Add support for Score binaries.
diff --git a/binutils/configure b/binutils/configure
index 505a1e4..e74cb9d 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -8445,6 +8445,12 @@ do
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
+ x86_64-*-mingw64*)
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+ BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
+ ;;
i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
diff --git a/binutils/configure.in b/binutils/configure.in
index 95a26cc..5f09e8e 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -257,6 +257,14 @@ changequote([,])dnl
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
;;
+ x86_64-*-mingw64*)
+changequote([,])dnl
+ BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+ DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
+ BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+ BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
+ ;;
+changequote(,)dnl
changequote(,)dnl
i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
changequote([,])dnl
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index b09c94e..8a449a0 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -261,6 +261,9 @@
#include "coff/arm.h"
#include "coff/internal.h"
#endif
+#ifdef DLLTOOL_MX86_64
+#include "coff/x86_64.h"
+#endif
/* Forward references. */
static char *look_for_prog (const char *, const char *, int);
@@ -398,6 +401,10 @@ static const char *mname = "arm";
static const char *mname = "i386";
#endif
+#ifdef DLLTOOL_MX86_64
+static const char *mname = "i386:x86-64";
+#endif
+
#ifdef DLLTOOL_PPC
static const char *mname = "ppc";
#endif
@@ -640,6 +647,14 @@ mtable[] =
arm_jtab, sizeof (arm_jtab), 8
}
,
+ {
+#define MX86 11
+ "i386:x86-64", ".byte", ".short", ".long", ".asciz", "#",
+ "jmp *", ".global", ".space", ".align\t2",".align\t4", "",
+ "pe-x86-64",bfd_arch_i386,
+ i386_jtab, sizeof (i386_jtab), 2
+ }
+ ,
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
@@ -763,6 +778,7 @@ rvaafter (int machine)
{
case MARM:
case M386:
+ case MX86:
case MPPC:
case MTHUMB:
case MARM_INTERWORK:
@@ -788,6 +804,7 @@ rvabefore (int machine)
{
case MARM:
case M386:
+ case MX86:
case MPPC:
case MTHUMB:
case MARM_INTERWORK:
@@ -823,6 +840,7 @@ asm_prefix (int machine, const char *name)
case MARM_WINCE:
break;
case M386:
+ case MX86:
/* Symbol names starting with ? do not have a leading underscore. */
if (name && *name == '?')
break;
@@ -1700,10 +1718,19 @@ generate_idata_ofile (FILE *filvar)
for (headptr = import_list; headptr != NULL; headptr = headptr->next)
{
fprintf (filvar, "listone%d:\n", headindex);
- for ( funcindex = 0; funcindex < headptr->nfuncs; funcindex++ )
+ for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++)
+#ifdef DLLTOOL_MX86_64
+ fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n",
+ ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG);
+#else
fprintf (filvar, "\t%sfuncptr%d_%d%s\n",
ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER);
- fprintf (filvar,"\t%s\t0\n", ASM_LONG); /* NULL terminating list */
+#endif
+#ifdef DLLTOOL_MX86_64
+ fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
+#else
+ fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
+#endif
headindex++;
}
@@ -1712,10 +1739,19 @@ generate_idata_ofile (FILE *filvar)
for (headptr = import_list; headptr != NULL; headptr = headptr->next)
{
fprintf (filvar, "listtwo%d:\n", headindex);
- for ( funcindex = 0; funcindex < headptr->nfuncs; funcindex++ )
+ for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++)
+#ifdef DLLTOOL_MX86_64
+ fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n",
+ ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG);
+#else
fprintf (filvar, "\t%sfuncptr%d_%d%s\n",
ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER);
- fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list */
+#endif
+#ifdef DLLTOOL_MX86_64
+ fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
+#else
+ fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
+#endif
headindex++;
}
@@ -2358,7 +2394,7 @@ make_one_lib_file (export_type *exp, int i)
si->data = xmalloc (HOW_JTAB_SIZE);
memcpy (si->data, HOW_JTAB, HOW_JTAB_SIZE);
- /* add the reloc into idata$5 */
+ /* Add the reloc into idata$5. */
rel = xmalloc (sizeof (arelent));
rpp = xmalloc (sizeof (arelent *) * 2);
@@ -2388,6 +2424,36 @@ make_one_lib_file (export_type *exp, int i)
/* An idata$4 or idata$5 is one word long, and has an
rva to idata$6. */
+#ifdef DLLTOOL_MX86_64
+ si->data = xmalloc (8);
+ si->size = 8;
+
+ if (exp->noname)
+ {
+ si->data[0] = exp->ordinal ;
+ si->data[1] = exp->ordinal >> 8;
+ si->data[2] = exp->ordinal >> 16;
+ si->data[3] = exp->ordinal >> 24;
+ si->data[4] = 0;
+ si->data[5] = 0;
+ si->data[6] = 0;
+ si->data[7] = 0x80;
+ }
+ else
+ {
+ sec->reloc_count = 1;
+ memset (si->data, 0, si->size);
+ rel = xmalloc (sizeof (arelent));
+ rpp = xmalloc (sizeof (arelent *) * 2);
+ rpp[0] = rel;
+ rpp[1] = 0;
+ rel->address = 0;
+ rel->addend = 0;
+ rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_RVA);
+ rel->sym_ptr_ptr = secdata[IDATA6].sympp;
+ sec->orelocation = rpp;
+ }
+#else
si->data = xmalloc (4);
si->size = 4;
@@ -2412,7 +2478,7 @@ make_one_lib_file (export_type *exp, int i)
rel->sym_ptr_ptr = secdata[IDATA6].sympp;
sec->orelocation = rpp;
}
-
+#endif
break;
case IDATA6:
@@ -2626,14 +2692,17 @@ make_head (void)
if (!no_idata5)
{
fprintf (f, "\t.section\t.idata$5\n");
- fprintf (f, "\t%s\t0\n", ASM_LONG);
+#ifdef DLLTOOL_MX86_64
+ fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
+#else
+ fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
+#endif
fprintf (f, "fthunk:\n");
}
if (!no_idata4)
{
fprintf (f, "\t.section\t.idata$4\n");
-
fprintf (f, "\t%s\t0\n", ASM_LONG);
fprintf (f, "\t.section .idata$4\n");
fprintf (f, "hname:\n");
@@ -2660,13 +2729,21 @@ make_tail (void)
if (!no_idata4)
{
fprintf (f, "\t.section .idata$4\n");
- fprintf (f, "\t%s\t0\n", ASM_LONG);
+#ifdef DLLTOOL_MX86_64
+ fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
+#else
+ fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
+#endif
}
if (!no_idata5)
{
fprintf (f, "\t.section .idata$5\n");
- fprintf (f, "\t%s\t0\n", ASM_LONG);
+#ifdef DLLTOOL_MX86_64
+ fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
+#else
+ fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
+#endif
}
#ifdef DLLTOOL_PPC
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index a22c22f..ca065c2 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2006-09-20 Kai Tietz <Kai.Tietz@onevision.com>
+
+ * binutils-all/copy-3.d: Add support for target x86_64-pc-mingw64.
+ * binutils-all/dlltool.exp: Likewise.
+ * binutils-all/objcopy.exp: Likewise.
+ * binutils-all/windres/windres.exp: Likewise.
+ * binutils-all/windres/lang.rc: xfail it as long as there is no windows.h.
+ * binutils-all/windres/strtab1.rc: Likewise.
+ * lib/utils-lib.exp: Adjust executable prefix detection (as .exe).
+
2006-09-14 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/3181
diff --git a/binutils/testsuite/binutils-all/copy-3.d b/binutils/testsuite/binutils-all/copy-3.d
index be3eea4..4bea36f 100644
--- a/binutils/testsuite/binutils-all/copy-3.d
+++ b/binutils/testsuite/binutils-all/copy-3.d
@@ -3,7 +3,7 @@
#objcopy: --set-section-flags .text=alloc,data
#name: copy with setting section flags 3
#source: bintest.s
-#not-target: *-*-aout *-*-*pe *-*-*coff i*86-*-cygwin* i*86-*-mingw32*
+#not-target: *-*-aout *-*-*pe *-*-*coff i*86-*-cygwin* i*86-*-mingw32* x86_64-*-mingw64*
# The .text # section in PE/COFF has a fixed set of flags and these
# cannot be changed. We skip it for them.
diff --git a/binutils/testsuite/binutils-all/dlltool.exp b/binutils/testsuite/binutils-all/dlltool.exp
index 6ddfcfa..96b6782 100644
--- a/binutils/testsuite/binutils-all/dlltool.exp
+++ b/binutils/testsuite/binutils-all/dlltool.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2004 Free Software Foundation, Inc.
+# Copyright 2002, 2004, 2006 Free Software Foundation, Inc.
# 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
@@ -14,13 +14,14 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
-if {![istarget "i*86-*-*"]} {
+if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw64*"] } {
return
}
if {![istarget "i*86-*-*pe*"] \
&& ![istarget "i*86-*-cygwin*"] \
- && ![istarget "i*86-*-mingw32*"] } {
+ && ![istarget "i*86-*-mingw32*"] \
+ && ![istarget "x86_64-*-mingw64*"] } {
set target_xfail "yes"
} else {
set target_xfail "no"
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 96ae518..3ab38ec 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1,5 +1,5 @@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004
+# 2004, 2006
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -443,7 +443,7 @@ strip_test_with_saving_a_symbol
# Build a final executable.
-if { [istarget *-*-cygwin] || [istarget *-*-mingw32] } {
+if { [istarget *-*-cygwin] || [istarget *-*-mingw*] } {
set test_prog "testprog.exe"
} else {
set test_prog "testprog"
diff --git a/binutils/testsuite/binutils-all/windres/lang.rc b/binutils/testsuite/binutils-all/windres/lang.rc
index d894315..f3da105 100644
--- a/binutils/testsuite/binutils-all/windres/lang.rc
+++ b/binutils/testsuite/binutils-all/windres/lang.rc
@@ -1,3 +1,4 @@
+//#xfail *-*-mingw64
#include "windows.h"
LANGUAGE 0, 0
diff --git a/binutils/testsuite/binutils-all/windres/strtab1.rc b/binutils/testsuite/binutils-all/windres/strtab1.rc
index a1a246d..48fd107 100644
--- a/binutils/testsuite/binutils-all/windres/strtab1.rc
+++ b/binutils/testsuite/binutils-all/windres/strtab1.rc
@@ -1,3 +1,4 @@
+//#xfail *-*-mingw64
#include "windows.h"
LANGUAGE 0, 0
diff --git a/binutils/testsuite/binutils-all/windres/windres.exp b/binutils/testsuite/binutils-all/windres/windres.exp
index 4189c55..2c836b8 100644
--- a/binutils/testsuite/binutils-all/windres/windres.exp
+++ b/binutils/testsuite/binutils-all/windres/windres.exp
@@ -1,4 +1,4 @@
-# Copyright 2001, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
# 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
@@ -19,13 +19,14 @@
# Written by DJ Delorie <dj@redhat.com>
-if {![istarget "i*86-*-*"]} {
+if {![istarget "i*86-*-*"] && ![istarget "x86_64-*-mingw64"] } {
return
}
if {![istarget "i*86-*-*pe*"] \
&& ![istarget "i*86-*-cygwin*"] \
- && ![istarget "i*86-*-mingw32*"] } {
+ && ![istarget "i*86-*-mingw32*"] \
+ && ![istarget "x86_64-*-mingw64*"] } {
set target_xfail "yes"
} else {
set target_xfail "no"
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index b914500..597437e 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -1,4 +1,4 @@
-# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004
+# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -161,7 +161,7 @@ proc is_elf_format {} {
# Returns target executable extension, if any.
#
proc exe_ext {} {
- if { [istarget *-*-mingw32] || [istarget *-*-cygwin*] } {
+ if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } {
return ".exe"
} else {
return ""