SHA256
1
0
forked from pool/grub2

Accepting request 246608 from home:Andreas_Schwab:Factory

- aarch64-reloc.patch: replace with upstream solution

OBS-URL: https://build.opensuse.org/request/show/246608
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=110
This commit is contained in:
Andrei Borzenkov 2014-08-27 10:07:53 +00:00 committed by Git OBS Bridge
parent a15924f2d5
commit b3c9ac672c
2 changed files with 27 additions and 51 deletions

View File

@ -1,56 +1,27 @@
From f472bc5ac54e72eb09b0606f588085af504d754b Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Tue, 12 Aug 2014 10:42:43 +0200
Subject: [PATCH] Support R_AARCH64_PREL32 relocation
From 668add258ff7ffcfdc2c501fe5eb32e53c69b6f4 Mon Sep 17 00:00:00 2001
From: Andrey Borzenkov <arvidjaar@gmail.com>
Date: Mon, 30 Dec 2013 12:56:19 +0000
Subject: [PATCH] strip .eh_frame section from arm64-efi kernel
* include/grub/elf.h (R_AARCH64_PREL32): Define.
* util/grub-mkimagexx.c (make_reloc_section): Handle it.
(relocate_addresses): Likewise.
Fixes grub-mkimage error "relocation 0x105 is not implemented yet."
---
include/grub/elf.h | 1 +
util/grub-mkimagexx.c | 10 ++++++++++
2 files changed, 11 insertions(+)
ChangeLog | 4 ++++
grub-core/Makefile.core.def | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/grub/elf.h b/include/grub/elf.h
index caa7963..836b304 100644
--- a/include/grub/elf.h
+++ b/include/grub/elf.h
@@ -2070,6 +2070,7 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_AARCH64_ABS32 258 /* Direct 32 bit. */
#define R_AARCH64_JUMP26 282 /* 26-bit relative. */
#define R_AARCH64_CALL26 283 /* 26-bit relative. */
+#define R_AARCH64_PREL32 261 /* 32-bit pc-relative. */
#define R_AARCH64_COPY 1024 /* Copy symbol at runtime. */
#define R_AARCH64_GLOB_DAT 1025 /* Create GOT entry. */
#define R_AARCH64_JUMP_SLOT 1026 /* Create PLT entry. */
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index 0a1ac9e..376dc2d 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -836,6 +836,15 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
*target = grub_host_to_target64 (grub_target_to_host64 (*target) + sym_addr);
}
break;
+ case R_AARCH64_PREL32:
+ {
+ grub_uint32_t *t32 = (grub_uint32_t *) target;
+ *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32)
+ + sym_addr
+ - target_section_addr - offset
+ - image_target->vaddr_offset);
+ break;
+ }
case R_AARCH64_JUMP26:
case R_AARCH64_CALL26:
{
@@ -1197,6 +1206,7 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out,
}
break;
/* Relative relocations do not require fixup entries. */
+ case R_AARCH64_PREL32:
case R_AARCH64_CALL26:
case R_AARCH64_JUMP26:
break;
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index c916246..42443bc 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -66,7 +66,7 @@ kernel = {
arm_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
arm64_efi_ldflags = '-Wl,-r,-d';
- arm64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
+ arm64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version -R .eh_frame';
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000';
--
2.0.4
2.1.0

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Aug 27 07:53:35 UTC 2014 - schwab@suse.de
- aarch64-reloc.patch: replace with upstream solution
-------------------------------------------------------------------
Mon Aug 25 03:10:18 UTC 2014 - mchang@suse.com