dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0276-module-verifier-allow-limited-range-relocations-on-s.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Vladimir Serbinenko <phcoder@gmail.com>
f725e3
Date: Thu, 31 Dec 2015 18:30:39 +0100
f725e3
Subject: [PATCH] module-verifier: allow limited-range relocations on sparc64.
f725e3
f725e3
clang as incomplete mcmodel=large support. As we don't currently need full
f725e3
mcmodel=large support for sparc64, relax those checks.
f725e3
---
f725e3
 util/grub-module-verifier.c | 7 ++++++-
f725e3
 1 file changed, 6 insertions(+), 1 deletion(-)
f725e3
f725e3
diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
f725e3
index c027f0a0fb1..e217dcddc07 100644
f725e3
--- a/util/grub-module-verifier.c
f725e3
+++ b/util/grub-module-verifier.c
f725e3
@@ -38,7 +38,12 @@ struct grub_module_verifier_arch archs[] = {
f725e3
       R_SPARC_LO10,
f725e3
       R_SPARC_64,
f725e3
       R_SPARC_OLO10,
f725e3
-      /* R_SPARC_32, R_SPARC_HI22  are supported but shouldn't be used because of their limited range.  */
f725e3
+      /* Following 2 relocations have limited range but unfortunately
f725e3
+	 clang generates them, as it doesn't implement mcmodel=large properly.
f725e3
+	 At least our heap and core are under 4G, so it's not a problem
f725e3
+	 usually. */
f725e3
+      R_SPARC_HI22,
f725e3
+      R_SPARC_32,
f725e3
       -1
f725e3
     } },
f725e3
   { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){