From 872ce6ff99eaf767ce26c1c69d11b7d910274dbc Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 4 Jul 2007 15:32:46 +0000 Subject: [PATCH] gas/ 2007-07-04 H.J. Lu * config/obj-coff.h (x86_64_target_format): Renamed to ... (i386_target_format): This (TARGET_FORMAT): Use i386_target_format. * config/tc-i386.c (x86_64_target_format): Removed. (i386_target_format): Handle PE formats. gas/testsuite/ 2007-07-04 H.J. Lu * gas/i386/i386.exp: Run x86-64-nops-1 for x86_64-*-mingw*. --- gas/ChangeLog | 9 +++++++++ gas/config/obj-coff.h | 4 ++-- gas/config/tc-i386.c | 27 ++++++--------------------- gas/testsuite/ChangeLog | 4 ++++ gas/testsuite/gas/i386/i386.exp | 4 +--- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index caf11f04cf7..32aa3fad28d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2007-07-04 H.J. Lu + + * config/obj-coff.h (x86_64_target_format): Renamed to ... + (i386_target_format): This + (TARGET_FORMAT): Use i386_target_format. + + * config/tc-i386.c (x86_64_target_format): Removed. + (i386_target_format): Handle PE formats. + 2007-07-04 Nick Clifton * symbols.c (symbol_relc_make_value): Use bfd_sprintf_vma in order diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 407dcd5f133..d7e985dd97b 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -63,8 +63,8 @@ #ifdef TE_PE #ifdef TE_PEP -extern const char * x86_64_target_format (void); -#define TARGET_FORMAT x86_64_target_format () +extern const char *i386_target_format (void); +#define TARGET_FORMAT i386_target_format () #define COFF_TARGET_FORMAT "pe-x86-64" #else #define TARGET_FORMAT "pe-i386" diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 9d5a923c22d..4514858fea4 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6115,28 +6115,8 @@ md_show_usage (stream) } -#if defined(TE_PEP) -const char * -x86_64_target_format (void) -{ - if (strcmp (default_arch, "x86_64") == 0) - { - set_code_flag (CODE_64BIT); - return COFF_TARGET_FORMAT; - } - else if (strcmp (default_arch, "i386") == 0) - { - set_code_flag (CODE_32BIT); - return "coff-i386"; - } - - as_fatal (_("Unknown architecture")); - return NULL; -} -#endif - #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ - || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) + || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined (TE_PEP)) /* Pick the target format to use. */ @@ -6167,6 +6147,11 @@ i386_target_format (void) as_fatal (_("Unknown architecture")); switch (OUTPUT_FLAVOR) { +#ifdef TE_PEP + case bfd_target_coff_flavour: + return flag_code == CODE_64BIT ? COFF_TARGET_FORMAT : "coff-i386"; + break; +#endif #ifdef OBJ_MAYBE_AOUT case bfd_target_aout_flavour: return AOUT_TARGET_FORMAT; diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 755e6825cc5..09aacdbbf79 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-07-04 H.J. Lu + + * gas/i386/i386.exp: Run x86-64-nops-1 for x86_64-*-mingw*. + 2007-07-04 Nick Clifton * gas/mep/relocs.d: Fix expected disassembly to work on 64-bit diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 8f0437c4738..9e463de6a54 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -161,9 +161,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-io-suffix" run_dump_test "x86-64-gidt" run_dump_test "x86-64-nops" - if ![istarget "x86_64-*-mingw*"] then { - run_dump_test "x86-64-nops-1" - } + run_dump_test "x86-64-nops-1" run_dump_test "x86-64-nops-1-k8" run_dump_test "x86-64-nops-1-nocona" run_dump_test "x86-64-nops-1-merom" -- 2.30.2