From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WIjHA-0001YR-9e for mharc-grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIjGz-0001CO-1n for grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIjGq-00015a-3Z for grub-devel@gnu.org; Wed, 26 Feb 2014 13:32:00 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:57214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIjGp-00015V-SI for grub-devel@gnu.org; Wed, 26 Feb 2014 13:31:52 -0500 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Feb 2014 11:31:51 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 26 Feb 2014 11:31:50 -0700 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id F072319D8039 for ; Wed, 26 Feb 2014 11:31:47 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08027.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1QIVNQG7274804 for ; Wed, 26 Feb 2014 19:31:23 +0100 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1QIVnLO015835 for ; Wed, 26 Feb 2014 11:31:49 -0700 Received: from ram.oc3035372033.ibm.com.com (sig-9-65-83-23.mts.ibm.com [9.65.83.23]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s1QIVZLU014663; Wed, 26 Feb 2014 11:31:47 -0700 From: Ram Pai To: grub-devel@gnu.org Subject: [RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image. Date: Wed, 26 Feb 2014 10:31:04 -0800 Message-Id: <1393439482-20341-6-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1393439482-20341-1-git-send-email-linuxram@us.ibm.com> References: <1393439482-20341-1-git-send-email-linuxram@us.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14022618-6688-0000-0000-000007007DF5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.110.153 Cc: tonyb@au1.ibm.com, anton@au1.ibm.com, linuxram@us.ibm.com, tlfalcon@linux.vnet.ibm.com, tbberry@us.ibm.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 18:32:10 -0000 set the ABI version to 0x02 in the e_flag of the PPC64LE ELF image. Signed-off-by: Ram Pai --- include/grub/elf.h | 1 + util/grub-mkimagexx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/grub/elf.h b/include/grub/elf.h index caa7963..bee7583 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -1851,6 +1851,7 @@ typedef Elf32_Addr Elf32_Conflict; /* Values for Elf32/64_Ehdr.e_flags. */ #define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */ +#define EF_PPC64LE_ABIV2 0x00000002 /* PowerPC 64 LE flag */ /* Cygnus local bits below */ #define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/ diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 0a1ac9e..b1833a1 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -141,11 +141,15 @@ SUFFIX (generate_elf) (const struct grub_install_image_target_desc *image_target phdr->p_vaddr = grub_host_to_target32 (target_addr); phdr->p_paddr = grub_host_to_target32 (target_addr); phdr->p_align = grub_host_to_target32 (align > image_target->link_align ? align : image_target->link_align); + if (image_target->id == IMAGE_LOONGSON_ELF) ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER | EF_MIPS_PIC | EF_MIPS_CPIC); + else if (image_target->id == IMAGE_PPC && image_target->bigendian == 0) + ehdr->e_flags = grub_host_to_target32 (EF_PPC64LE_ABIV2); else ehdr->e_flags = 0; + if (image_target->id == IMAGE_LOONGSON_ELF) { phdr->p_filesz = grub_host_to_target32 (*core_size); -- 1.8.5.3