This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Make use of meabi_flags in tc-arm.c be ELF specific
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 30 Mar 2004 09:52:02 +0100
- Subject: Make use of meabi_flags in tc-arm.c be ELF specific
Hi Guys,
I am applying the patch below to fix tc-arm.c so that it will build
for non-ELF ARM targets.
Cheers
Nick
gas/ChangeLog
2004-03-30 Nick Clifton <nickc@redhat.com>
* config/tc-arm.c (meabi_flags): Make its use conditional upon
OBJ_ELF being defined.
Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.164
diff -c -3 -p -r1.164 tc-arm.c
*** gas/config/tc-arm.c 23 Mar 2004 23:05:52 -0000 1.164
--- gas/config/tc-arm.c 30 Mar 2004 08:49:19 -0000
*************** static int march_cpu_opt = -1;
*** 191,197 ****
--- 191,199 ----
static int march_fpu_opt = -1;
static int mfpu_opt = -1;
static int mfloat_abi_opt = -1;
+ #ifdef OBJ_ELF
static int meabi_flags = EF_ARM_EABI_UNKNOWN;
+ #endif
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. */
*************** static int arm_parse_cpu PARAMS ((char *
*** 2552,2558 ****
--- 2554,2562 ----
static int arm_parse_arch PARAMS ((char *));
static int arm_parse_fpu PARAMS ((char *));
static int arm_parse_float_abi PARAMS ((char *));
+ #ifdef OBJ_ELF
static int arm_parse_eabi PARAMS ((char *));
+ #endif
#if 0 /* Suppressed - for now. */
#if defined OBJ_COFF || defined OBJ_ELF
static void arm_add_note PARAMS ((const char *, const char *, unsigned int));
*************** md_begin ()
*** 11687,11699 ****
cpu_variant = mcpu_cpu_opt | mfpu_opt;
- #if defined OBJ_COFF || defined OBJ_ELF
{
! unsigned int flags = meabi_flags;
switch (meabi_flags)
{
case EF_ARM_EABI_UNKNOWN:
/* Set the flags in the private structure. */
if (uses_apcs_26) flags |= F_APCS26;
if (support_interwork) flags |= F_INTERWORK;
--- 11691,11707 ----
cpu_variant = mcpu_cpu_opt | mfpu_opt;
{
! unsigned int flags = 0;
!
! #if defined OBJ_ELF
! flags = meabi_flags;
switch (meabi_flags)
{
case EF_ARM_EABI_UNKNOWN:
+ #endif
+ #if defined OBJ_COFF || defined OBJ_ELF
/* Set the flags in the private structure. */
if (uses_apcs_26) flags |= F_APCS26;
if (support_interwork) flags |= F_INTERWORK;
*************** md_begin ()
*** 11701,11709 ****
if (pic_code) flags |= F_PIC;
if ((cpu_variant & FPU_ANY) == FPU_NONE
|| (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */
! {
! flags |= F_SOFT_FLOAT;
! }
switch (mfloat_abi_opt)
{
case ARM_FLOAT_ABI_SOFT:
--- 11709,11716 ----
if (pic_code) flags |= F_PIC;
if ((cpu_variant & FPU_ANY) == FPU_NONE
|| (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */
! flags |= F_SOFT_FLOAT;
!
switch (mfloat_abi_opt)
{
case ARM_FLOAT_ABI_SOFT:
*************** md_begin ()
*** 11716,11728 ****
as_bad (_("hard-float conflicts with specified fpu"));
break;
}
- /* 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 & FPU_ARCH_MAVERICK)
flags |= EF_ARM_MAVERICK_FLOAT;
- #endif
break;
case EF_ARM_EABI_VER3:
--- 11723,11736 ----
as_bad (_("hard-float conflicts with specified fpu"));
break;
}
+ /* Using VFP conventions (even if soft-float). */
+ if (cpu_variant & FPU_VFP_EXT_NONE)
+ flags |= F_VFP_FLOAT;
+ #endif
#if defined OBJ_ELF
if (cpu_variant & FPU_ARCH_MAVERICK)
flags |= EF_ARM_MAVERICK_FLOAT;
break;
case EF_ARM_EABI_VER3:
*************** md_begin ()
*** 11732,11738 ****
default:
abort ();
}
!
bfd_set_private_flags (stdoutput, flags);
/* We have run out flags in the COFF header to encode the
--- 11740,11747 ----
default:
abort ();
}
! #endif
! #if defined OBJ_COFF || defined OBJ_ELF
bfd_set_private_flags (stdoutput, flags);
/* We have run out flags in the COFF header to encode the
*************** md_begin ()
*** 11752,11759 ****
bfd_set_section_contents (stdoutput, sec, NULL, 0, 0);
}
}
- }
#endif
/* Record the CPU type as well. */
switch (cpu_variant & ARM_CPU_MASK)
--- 11761,11768 ----
bfd_set_section_contents (stdoutput, sec, NULL, 0, 0);
}
}
#endif
+ }
/* Record the CPU type as well. */
switch (cpu_variant & ARM_CPU_MASK)
*************** struct arm_eabi_option_table
*** 13470,13475 ****
--- 13479,13485 ----
unsigned int value;
};
+ #ifdef OBJ_ELF
/* We only know hot to output GNU and ver 3 (AAELF) formats. */
static struct arm_eabi_option_table arm_eabis[] =
{
*************** static struct arm_eabi_option_table arm_
*** 13477,13482 ****
--- 13487,13493 ----
{"3", EF_ARM_EABI_VER3},
{NULL, 0}
};
+ #endif
struct arm_long_option_table
{
*************** arm_parse_float_abi (str)
*** 13641,13646 ****
--- 13652,13658 ----
return 0;
}
+ #ifdef OBJ_ELF
static int
arm_parse_eabi (str)
char * str;
*************** arm_parse_eabi (str)
*** 13656,13661 ****
--- 13668,13674 ----
as_bad (_("unknown EABI `%s'\n"), str);
return 0;
}
+ #endif
struct arm_long_option_table arm_long_opts[] =
{
*************** struct arm_long_option_table arm_long_op
*** 13667,13674 ****
--- 13680,13689 ----
arm_parse_fpu, NULL},
{"mfloat-abi=", N_("<abi>\t assemble for floating point ABI <abi>"),
arm_parse_float_abi, NULL},
+ #ifdef OBJ_ELF
{"meabi=", N_("<ver>\t assemble for eabi version <ver>"),
arm_parse_eabi, NULL},
+ #endif
{NULL, NULL, 0, NULL}
};