From b6af357683133963bc393f5d8b2cfc1d2830f9ea Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 13 Nov 2002 03:01:24 +0000 Subject: [PATCH] Merge from mainline. 2002-09-04 Alan Modra * config/tc-ppc.c (PPC_HIGHER, PPC_HIGHEST): Fix warning. (md_parse_option): No -a64 without BFD64. (ppc_set_cpu): Select appropriate cpu when ppc_obj64. (ppc_arch): Use bfd_mach_rs6k for bfd_arch_rs6000. --- gas/ChangeLog | 9 +++++++++ gas/config/tc-ppc.c | 25 +++++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 2416a3f..ab604b7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2002-11-13 Alan Modra + + Merge from mainline. + 2002-09-04 Alan Modra + * config/tc-ppc.c (PPC_HIGHER, PPC_HIGHEST): Fix warning. + (md_parse_option): No -a64 without BFD64. + (ppc_set_cpu): Select appropriate cpu when ppc_obj64. + (ppc_arch): Use bfd_mach_rs6k for bfd_arch_rs6000. + 2002-11-06 Richard Henderson * config/tc-alpha.c (alpha_validate_fix): Move code ... diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index c743c54..d7e8e69 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -68,14 +68,14 @@ static int set_target_endian = 0; #define PPC_HA(v) PPC_HI ((v) + 0x8000) /* #higher(value) denotes bits 32 through 47 of the indicated value. */ -#define PPC_HIGHER(v) (((v) >> 32) & 0xffff) +#define PPC_HIGHER(v) (((v) >> 16 >> 16) & 0xffff) /* #highera(value) denotes bits 32 through 47 of the indicated value, compensating for #lo() being treated as a signed number. */ #define PPC_HIGHERA(v) PPC_HIGHER ((v) + 0x8000) /* #highest(value) denotes bits 48 through 63 of the indicated value. */ -#define PPC_HIGHEST(v) (((v) >> 48) & 0xffff) +#define PPC_HIGHEST(v) (((v) >> 24 >> 24) & 0xffff) /* #highesta(value) denotes bits 48 through 63 of the indicated value, compensating for #lo being treated as a signed number. */ @@ -852,7 +852,13 @@ md_parse_option (c, arg) /* a64 and a32 determine whether to use XCOFF64 or XCOFF32. */ case 'a': if (strcmp (arg, "64") == 0) - ppc_obj64 = 1; + { +#ifdef BFD64 + ppc_obj64 = 1; +#else + as_fatal (_("%s unsupported"), "-a64"); +#endif + } else if (strcmp (arg, "32") == 0) ppc_obj64 = 0; else @@ -1062,8 +1068,10 @@ ppc_set_cpu () if (ppc_cpu == 0) { - if (strncmp (default_os, "aix", 3) == 0 - && default_os[3] >= '4' && default_os[3] <= '9') + if (ppc_obj64) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64; + else if (strncmp (default_os, "aix", 3) == 0 + && default_os[3] >= '4' && default_os[3] <= '9') ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32; else if (strncmp (default_os, "aix3", 4) == 0) ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32; @@ -1109,7 +1117,12 @@ ppc_arch () unsigned long ppc_mach () { - return ppc_obj64 ? bfd_mach_ppc64 : bfd_mach_ppc; + if (ppc_obj64) + return bfd_mach_ppc64; + else if (ppc_arch () == bfd_arch_rs6000) + return bfd_mach_rs6k; + else + return bfd_mach_ppc; } extern char* -- 2.7.4