From fde78edd7af5c957f88e3a8c4266c663a8bd2df0 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 10 Feb 2003 10:44:48 +0000 Subject: [PATCH] Add support for marking ARM ELF binaries as support the Cirrus EP9312 Maverick floating point co-processor. --- bfd/ChangeLog | 11 +++++++++++ bfd/archures.c | 1 + bfd/bfd-in2.h | 1 + bfd/cpu-arm.c | 6 ++++-- bfd/elf32-arm.h | 25 ++++++++++++++++++++++--- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 4 ++++ gas/ChangeLog | 6 ++++++ gas/config/tc-arm.c | 9 +++++++++ include/elf/ChangeLog | 4 ++++ include/elf/arm.h | 1 + 11 files changed, 68 insertions(+), 5 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 908c55e51f6..2e1138e3438 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2003-02-10 Nick Clifton + + * archures.c (bfd_mach_arm_ep9312): Define. + * bfd-in2.h: Regenerate. + * cpu-arm.c (processors[]): Add ep9312. + (bfd_arm_arch): Add ep9312. + * elf32-arm.h (elf32_arm_merge_private_data): Update error + messages and add test for Maverick floating point support. + (elf32_arm_print_private_bfd_data): Handle + EF_ARM_MAVERICK_FLOAT flag. + 2003-02-10 Alan Modra * elf64-ppc.c: Rename assorted occurrences of tls_type and similar diff --git a/bfd/archures.c b/bfd/archures.c index 08015f96dda..62edda109bb 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -234,6 +234,7 @@ DESCRIPTION .#define bfd_mach_arm_5T 8 .#define bfd_mach_arm_5TE 9 .#define bfd_mach_arm_XScale 10 +.#define bfd_mach_arm_ep9312 11 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 1820b232083..c9b973df27c 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1689,6 +1689,7 @@ enum bfd_architecture #define bfd_mach_arm_5T 8 #define bfd_mach_arm_5TE 9 #define bfd_mach_arm_XScale 10 +#define bfd_mach_arm_ep9312 11 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index cd4bf14eaa8..923c2500afe 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -95,7 +95,8 @@ processors[] = { bfd_mach_arm_4, "strongarm"}, { bfd_mach_arm_4, "strongarm110" }, { bfd_mach_arm_4, "strongarm1100" }, - { bfd_mach_arm_XScale, "xscale" } + { bfd_mach_arm_XScale, "xscale" }, + { bfd_mach_arm_ep9312, "ep9312" } }; static bfd_boolean @@ -140,7 +141,8 @@ static const bfd_arch_info_type arch_info_struct[] = N (bfd_mach_arm_5, "armv5", FALSE, & arch_info_struct[7]), N (bfd_mach_arm_5T, "armv5t", FALSE, & arch_info_struct[8]), N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]), - N (bfd_mach_arm_XScale, "xscale", FALSE, NULL) + N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]), + N (bfd_mach_arm_ep9312, "ep9312", FALSE, NULL) }; const bfd_arch_info_type bfd_arm_arch = diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 48eb873846e..3c56eb8ba79 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -2310,12 +2310,28 @@ ERROR: %s passes floats in integer registers, whereas %s passes them in float re { if (in_flags & EF_ARM_VFP_FLOAT) _bfd_error_handler (_("\ -ERROR: %s uses VFP instructions, whereas %s uses FPA instructions"), +ERROR: %s uses VFP instructions, whereas %s does not"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); else _bfd_error_handler (_("\ -ERROR: %s uses FPA instructions, whereas %s uses VFP instructions"), +ERROR: %s uses FPA instructions, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + + flags_compatible = FALSE; + } + + if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT)) + { + if (in_flags & EF_ARM_MAVERICK_FLOAT) + _bfd_error_handler (_("\ +ERROR: %s uses Maverick instructions, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + else + _bfd_error_handler (_("\ +ERROR: %s uses Maverick instructions, whereas %s does not"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); @@ -2410,6 +2426,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr) if (flags & EF_ARM_VFP_FLOAT) fprintf (file, _(" [VFP float format]")); + else if (flags & EF_ARM_MAVERICK_FLOAT) + fprintf (file, _(" [Maverick float format]")); else fprintf (file, _(" [FPA float format]")); @@ -2430,7 +2448,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr) flags &= ~(EF_ARM_INTERWORK | EF_ARM_APCS_26 | EF_ARM_APCS_FLOAT | EF_ARM_PIC | EF_ARM_NEW_ABI | EF_ARM_OLD_ABI - | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT); + | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT + | EF_ARM_MAVERICK_FLOAT); break; case EF_ARM_EABI_VER1: diff --git a/binutils/ChangeLog b/binutils/ChangeLog index d822fc92118..88c9d1e84fe 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2003-02-10 Nick Clifton + + * readelf.c (decode_ARM_machine_flags): Handle the + EF_ARM_MAVERICK_FLOAT flag. + 2003-02-04 Andreas Schwab * rddbg.c (read_section_stabs_debugging_info): Cast ptrdiff_t to diff --git a/binutils/readelf.c b/binutils/readelf.c index d427ce1591d..6a5986f11f2 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -1873,6 +1873,10 @@ decode_ARM_machine_flags (e_flags, buf) strcat (buf, ", software FP"); break; + case EF_ARM_MAVERICK_FLOAT: + strcat (buf, ", Maverick FP"); + break; + default: unknown = 1; break; diff --git a/gas/ChangeLog b/gas/ChangeLog index 698a405bc02..f44ae6ea13c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2003-02-10 Nick Clifton + + * config/tc-arm.c (md_begin): If the Maverick co-processor is + selected, set the EF_ARM_MAVERICK_FLOAT flag and + bfd_mach_arm_ep9312 machine number. + 2003-02-08 Richard Sandiford * config/tc-mips.c (reloc_needs_lo_p): New function. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index e58848614c1..40d35d78273 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -9278,6 +9278,13 @@ md_begin () /* Using VFP conventions (even if soft-float). */ if (cpu_variant & FPU_VFP_EXT_NONE) flags |= F_VFP_FLOAT; +#if defined OBJ_ELF + if (cpu_variant & ARM_CEXT_MAVERICK) + { + flags ^= F_SOFT_FLOAT; + flags |= EF_ARM_MAVERICK_FLOAT; + } +#endif bfd_set_private_flags (stdoutput, flags); @@ -9324,6 +9331,8 @@ md_begin () /* Catch special cases. */ if (cpu_variant & ARM_CEXT_XSCALE) mach = bfd_mach_arm_XScale; + else if (cpu_variant & ARM_CEXT_MAVERICK) + mach = bfd_mach_arm_ep9312; else if (cpu_variant & ARM_EXT_V5E) mach = bfd_mach_arm_5TE; else if (cpu_variant & ARM_EXT_V5) diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 88e8c96e566..6499ab3f4e1 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,7 @@ +2003-02-10 Nick Clifton + + * arm.h (EF_ARM_MAVERICK_FLOAT): Define. + 2003-02-05 Alan Modra * ppc.h: Add TLS relocs. Format. diff --git a/include/elf/arm.h b/include/elf/arm.h index 269a225dd02..534701753c4 100644 --- a/include/elf/arm.h +++ b/include/elf/arm.h @@ -34,6 +34,7 @@ #define EF_ARM_OLD_ABI 0x100 #define EF_ARM_SOFT_FLOAT 0x200 #define EF_ARM_VFP_FLOAT 0x400 +#define EF_ARM_MAVERICK_FLOAT 0x800 /* Other constants defined in the ARM ELF spec. version B-01. */ #define EF_ARM_SYMSARESORTED 0x04 /* NB conflicts with EF_INTERWORK */ -- 2.30.2