Blame SOURCES/0001-loader-aarch64-attempt-to-avoid-text-relocations-in-.patch

69b3e2
From fb93d3ff8b63bdfdf88a8f25a715f816a52d5dd8 Mon Sep 17 00:00:00 2001
69b3e2
From: Dave Airlie <airlied@redhat.com>
69b3e2
Date: Mon, 13 Dec 2021 14:50:06 +1000
69b3e2
Subject: [PATCH] loader/aarch64: attempt to avoid text relocations in the
69b3e2
 unknown code
69b3e2
69b3e2
The commit below added a TEXTREL into the loader library, TEXTRELs
69b3e2
and security people don't get on well, so we'd like to avoid that.
69b3e2
69b3e2
This is my attempt at fixing it, I'm not an aarch64 expert at all,
69b3e2
so I'd really appreciate someone who is to take a look.
69b3e2
69b3e2
Fixes: 4f78f14c0533 ("loader: Add aarch64 unknown ext chain implementation")
69b3e2
---
69b3e2
 loader/unknown_ext_chain_gas_aarch64.S | 3 ++-
69b3e2
 1 file changed, 2 insertions(+), 1 deletion(-)
69b3e2
69b3e2
diff --git a/loader/unknown_ext_chain_gas_aarch64.S b/loader/unknown_ext_chain_gas_aarch64.S
69b3e2
index 1e065007d..a1fa46205 100644
69b3e2
--- a/loader/unknown_ext_chain_gas_aarch64.S
69b3e2
+++ b/loader/unknown_ext_chain_gas_aarch64.S
69b3e2
@@ -50,7 +50,8 @@ terminError\num:
69b3e2
     mov     x0, x11                             // Vulkan instance pointer (first arg)
69b3e2
     mov     x1, VK_DEBUG_REPORT_ERROR_BIT_EXT   // The error logging bit (second arg)
69b3e2
     mov     x2, #0                              // Zero (third arg)
69b3e2
-    ldr     x3, =termin_error_string            // The error string (fourth arg)
69b3e2
+    adrp    x9, termin_error_string
69b3e2
+    ldr     x3, [x9, #:lo12:termin_error_string]            // The error string (fourth arg)
69b3e2
     ldr     x4, [x11, x10]                      // The function name (fifth arg)
69b3e2
     bl      loader_log                          // Log the error message before we crash
69b3e2
     mov     x0, #0
69b3e2
-- 
69b3e2
2.33.1
69b3e2