Index: src/gas/config/tc-i386.c =================================================================== --- src.orig/gas/config/tc-i386.c 2009-05-07 09:28:20.000000000 +0200 +++ src/gas/config/tc-i386.c 2009-05-19 13:25:16.525988100 +0200 @@ -8018,7 +8018,7 @@ struct option md_longopts[] = { {"32", no_argument, NULL, OPTION_32}, -#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) || defined(TE_PE) {"64", no_argument, NULL, OPTION_64}, #endif {"divide", no_argument, NULL, OPTION_DIVIDE}, @@ -8071,7 +8071,7 @@ .stab instead of .stab.excl. We always use .stab anyhow. */ break; #endif -#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) || defined(TE_PE) case OPTION_64: { const char **list, **l; @@ -8258,7 +8258,7 @@ fprintf (stream, _("\ -s ignored\n")); #endif -#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP) || defined(TE_PE) fprintf (stream, _("\ --32/--64 generate 32bit/64bit code\n")); #endif @@ -8305,7 +8305,8 @@ } #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ - || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined (TE_PEP)) + || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined (TE_PEP) \ + || defined (TE_PE)) /* Pick the target format to use. */ @@ -8362,9 +8363,13 @@ as_fatal (_("Unknown architecture")); switch (OUTPUT_FLAVOR) { -#ifdef TE_PEP +#if defined (TE_PEP) || defined (TE_PE) case bfd_target_coff_flavour: +#ifdef TE_PEP return flag_code == CODE_64BIT ? COFF_TARGET_FORMAT : "pe-i386"; +#else + return flag_code != CODE_64BIT ? COFF_TARGET_FORMAT : "pe-x86-64"; +#endif break; #endif #ifdef OBJ_MAYBE_AOUT Index: src/gas/config/obj-coff.h =================================================================== --- src.orig/gas/config/obj-coff.h 2007-07-04 17:32:45.000000000 +0200 +++ src/gas/config/obj-coff.h 2009-05-19 13:18:26.965454300 +0200 @@ -62,12 +62,12 @@ #endif #ifdef TE_PE -#ifdef TE_PEP extern const char *i386_target_format (void); #define TARGET_FORMAT i386_target_format () +#ifdef TE_PEP #define COFF_TARGET_FORMAT "pe-x86-64" #else -#define TARGET_FORMAT "pe-i386" +#define COFF_TARGET_FORMAT "pe-i386" #endif #endif