[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image.
From: |
Ram Pai |
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 |
set the ABI version to 0x02 in the e_flag of the PPC64LE ELF image.
Signed-off-by: Ram Pai <address@hidden>
---
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
- [RFC PATCH 00/23] grub 64bit little-endian on power, Ram Pai, 2014/02/26
- [RFC PATCH 01/23] Add a new architecture to the build process, Ram Pai, 2014/02/26
- [RFC PATCH 02/23] Build LE grub as O1, Ram Pai, 2014/02/26
- [RFC PATCH 03/23] ignore .TOC. symbol, Ram Pai, 2014/02/26
- [RFC PATCH 04/23] grub-install can now recognize and install a LE grub boot loader, Ram Pai, 2014/02/26
- [RFC PATCH 06/23] Add IEEE1275_ADDR helper, Ram Pai, 2014/02/26
- [RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image.,
Ram Pai <=
- [RFC PATCH 07/23] Fix some more warnings when casting., Ram Pai, 2014/02/26
- [RFC PATCH 08/23] Add powerpc64 types, Ram Pai, 2014/02/26
- [RFC PATCH 09/23] Fix warnings when building powerpc linux loader 64bit, Ram Pai, 2014/02/26
- [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues, Ram Pai, 2014/02/26
- [RFC PATCH 10/23] GRUB_ELF_R_PPC_* processing is applicable only for 32 bit bootloader., Ram Pai, 2014/02/26
- [RFC PATCH 12/23] Add powerpc64 ieee1275 trampoline, Ram Pai, 2014/02/26
- [RFC PATCH 13/23] Add 64bit support to powerpc startup code, Ram Pai, 2014/02/26
- [RFC PATCH 14/23] Add grub_dl_find_section_addr, Ram Pai, 2014/02/26
- [RFC PATCH 15/23] Add ppc64 relocations, Ram Pai, 2014/02/26
- [RFC PATCH 17/23] Use FUNC_START/FUNC_END for powerpc function definitions, Ram Pai, 2014/02/26