This is the mail archive of the binutils@sourceware.org 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]

Re: [committed, PATCH] Add EM_386/EM_IAMCU support to elfedit.c


On Wed, May 13, 2015 at 1:54 AM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, May 11, 2015 at 09:59:57AM -0700, H.J. Lu wrote:
>> binutils/
>>
>>       * elfedit.c (enum elfclass): New.
>>       (input_elf_class): Change type to enum elfclass.
>>       (output_elf_class): New.
>>       (elf_class): Change return type to enum elfclass.  Support EM_386
>>       and EM_IAMCU.
>>       (update_elf_header): Check if input and output ELF classes match.
>>       (elf_machine): Support EM_386 and EM_IAMCU.
>>       (main): Update input_elf_class.  Set output_elf_class.
>>       * doc/binutils.texi: Update elfedit.
>
> This change broke powerpc64-linux and probably every ELF target
> other than x86.
>

I checked in this to fix it.

Sorry for the inconvenience.

-- 
H.J.
----
>From aa9f7286724c2e47077f2f5456d464a961f8e8a4 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 13 May 2015 03:57:46 -0700
Subject: [PATCH] Return ELF_CLASS_BOTH by default

* elfedit.c (elf_class): Return ELF_CLASS_BOTH by default.
---
 binutils/ChangeLog | 4 ++++
 binutils/elfedit.c | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index ee9a793f..333a82d 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2015-05-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+ * elfedit.c (elf_class): Return ELF_CLASS_BOTH by default.
+
 2015-05-13  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

  * MAINTAINERS: Add myself as s390 and s390x maintainer.
diff --git a/binutils/elfedit.c b/binutils/elfedit.c
index 1bcb48a..02b9c98 100644
--- a/binutils/elfedit.c
+++ b/binutils/elfedit.c
@@ -82,8 +82,7 @@ elf_class (int mach)
     case EM_NONE:
       return ELF_CLASS_BOTH;
     default:
-      error (_("Unknown machine type: %d\n"), mach);
-      return ELF_CLASS_UNKNOWN;
+      return ELF_CLASS_BOTH;
     }
 }

-- 
2.1.0


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