kexec-tools/kexec-tools-2.0.13-arm64-Add-support-of-R_AARCH64_PREL32-relocation-in-.patch
Pingfan Liu aee378209e Add initial upstream support for kexec on aarch64
Fix Bug 925630 - kexec-tools: support for arm64
https://bugzilla.redhat.com/show_bug.cgi?id=925630
involves three things:
  1. back porting upstream code to enable the function of kexec-tools on arm64
     patchset backported from upstream:
        commit abdfe97736f89d9bc73662b9134604b0229a599e
        commit 522df5f7217fda01ece3f6ac3e9987b0320c2bb0
        commit 217bcc00c9309416a6c6cd0584196559d28a9259
  2. fix the arm related building issue by using autoreconf in spec file

  3. patches to fix the issue of higher version gcc used by koji (not upstrem yet,
     and the corresponding fix in kernel side is in other package)
        kexec-tools-2.0.13-arm64-Add-support-for-additional-relocations-in-the-kexec-purgatory-code.patch
        kexec-tools-2.0.13-arm64-Add-support-of-R_AARCH64_PREL32-relocation-in-.patch
[panand: apply patches in 3 of above paragraph]

Signed-off-by: Pingfan Liu <piliu@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Pratyush Anand <panand@redhat.com>
2016-10-27 14:44:13 +08:00

43 lines
1.3 KiB
Diff

From 3a3c61cb7f129936e5752d1ccc304c183575a8b0 Mon Sep 17 00:00:00 2001
Message-Id: <3a3c61cb7f129936e5752d1ccc304c183575a8b0.1477402102.git.panand@redhat.com>
From: Pratyush Anand <panand@redhat.com>
Date: Tue, 25 Oct 2016 18:55:49 +0530
Subject: [PATCH] arm64: Add support of R_AARCH64_PREL32 relocation in
purgatory
Signed-off-by: Pratyush Anand <panand@redhat.com>
---
kexec/arch/arm64/kexec-arm64.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index 218f0bc832cd..b12de4772412 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -720,6 +720,10 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym),
# define R_AARCH64_ABS64 257
#endif
+#if !defined(R_AARCH64_PREL32)
+# define R_AARCH64_PREL32 261
+#endif
+
#if !defined(R_AARCH64_LD_PREL_LO19)
# define R_AARCH64_LD_PREL_LO19 273
#endif
@@ -761,6 +765,11 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym),
loc64 = ptr;
*loc64 = cpu_to_elf64(ehdr, elf64_to_cpu(ehdr, *loc64) + value);
break;
+ case R_AARCH64_PREL32:
+ type = "PREL32";
+ loc32 = ptr;
+ *loc32 = cpu_to_elf32(ehdr, elf32_to_cpu(ehdr, *loc32) + value - address);
+ break;
case R_AARCH64_LD_PREL_LO19:
type = "LD_PREL_LO19";
loc32 = ptr;
--
2.7.4