This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[arm] Correct Arm EABI ELF version


When adding support for the ARM EABI, I got the version number in the ELF 
flags wrong.
Patch below fixes this.

I've removed the old -meabi=3 option because
(a) We don't know how to generate objects conforming to this version, so 
claiming support seems wrong.
(b) It's not used by any released versions of gcc.

Tested with cross to arm-none-eabi and built --enable-targets=all.
Ok?

Paul

2004-10-11  Paul Brook  <paul@codesourcery.com>

bdf/
 * elf32-arm.h: Support EABI version 4 objects.
binutils/
 * readelf.c (decode_ARM_machine_flags): Support EABI version 4.
gas.
 * config/tc-arm.c (md_begin): Change EF_ARM_EABI_VER3 to
 EF_ARM_EABI_VER4.
 (arm_eabis): Ditto.
 * doc/c-arm.texi: Document that we actually support -meabi=4, not
 -meabi=3.
include/
 * elf/arm.h (EF_ARM_EABI_VER4): Define.

Index: bfd/elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.149
diff -u -p -r1.149 elf32-arm.h
--- bfd/elf32-arm.h 8 Oct 2004 14:53:59 -0000 1.149
+++ bfd/elf32-arm.h 8 Oct 2004 16:12:52 -0000
@@ -25,9 +25,9 @@
 typedef unsigned long int insn32;
 typedef unsigned short int insn16;
 
-/* In lieu of proper flags, assume all EABIv3 objects are interworkable.  */
+/* In lieu of proper flags, assume all EABIv4 objects are interworkable.  */
 #define INTERWORK_FLAG(abfd)  \
-  (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) == EF_ARM_EABI_VER3 \
+  (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) == EF_ARM_EABI_VER4 \
   || (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK))
 
 /* The linker script knows the section names for placement.
@@ -2705,6 +2705,10 @@ elf32_arm_print_private_bfd_data (bfd *a
 
     case EF_ARM_EABI_VER3:
       fprintf (file, _(" [Version3 EABI]"));
+      break;
+
+    case EF_ARM_EABI_VER4:
+      fprintf (file, _(" [Version4 EABI]"));
 
       if (flags & EF_ARM_BE8)
  fprintf (file, _(" [BE8]"));
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.256
diff -u -p -r1.256 readelf.c
--- binutils/readelf.c 8 Oct 2004 13:54:59 -0000 1.256
+++ binutils/readelf.c 8 Oct 2004 16:12:54 -0000
@@ -1767,6 +1767,10 @@ decode_ARM_machine_flags (unsigned e_fla
 
     case EF_ARM_EABI_VER3:
       strcat (buf, ", Version3 EABI");
+      break;
+
+    case EF_ARM_EABI_VER4:
+      strcat (buf, ", Version4 EABI");
       while (e_flags)
  {
    unsigned flag;
Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.182
diff -u -p -r1.182 tc-arm.c
--- gas/config/tc-arm.c 5 Oct 2004 13:51:38 -0000 1.182
+++ gas/config/tc-arm.c 8 Oct 2004 16:12:56 -0000
@@ -11130,7 +11130,7 @@ md_begin (void)
      flags |= EF_ARM_MAVERICK_FLOAT;
  break;
 
-      case EF_ARM_EABI_VER3:
+      case EF_ARM_EABI_VER4:
  /* No additional flags to set.  */
  break;
 
@@ -12901,11 +12901,11 @@ struct arm_eabi_option_table
 };
 
 #ifdef OBJ_ELF
-/* We only know hot to output GNU and ver 3 (AAELF) formats.  */
+/* We only know how to output GNU and ver 4 (AAELF) formats.  */
 static struct arm_eabi_option_table arm_eabis[] =
 {
   {"gnu", EF_ARM_EABI_UNKNOWN},
-  {"3",  EF_ARM_EABI_VER3},
+  {"4",  EF_ARM_EABI_VER4},
   {NULL, 0}
 };
 #endif
Index: gas/doc/c-arm.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/c-arm.texi,v
retrieving revision 1.30
diff -u -p -r1.30 c-arm.texi
--- gas/doc/c-arm.texi 5 Oct 2004 13:51:39 -0000 1.30
+++ gas/doc/c-arm.texi 8 Oct 2004 16:12:56 -0000
@@ -243,7 +243,7 @@ conform to.
 The following values are recognised:
 @code{gnu}
 and
-@code{3}.
+@code{4}.
 
 @cindex @code{-EB} command line option, ARM
 @item -EB
Index: include/elf/arm.h
===================================================================
RCS file: /cvs/src/src/include/elf/arm.h,v
retrieving revision 1.17
diff -u -p -r1.17 arm.h
--- include/elf/arm.h 1 Oct 2004 12:59:35 -0000 1.17
+++ include/elf/arm.h 8 Oct 2004 16:12:57 -0000
@@ -51,6 +51,7 @@
 #define EF_ARM_EABI_VER1     0x01000000
 #define EF_ARM_EABI_VER2     0x02000000
 #define EF_ARM_EABI_VER3     0x03000000
+#define EF_ARM_EABI_VER4     0x04000000
 
 /* Local aliases for some flags to match names used by COFF port.  */
 #define F_INTERWORK    EF_ARM_INTERWORK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]