[Concept,06/13] efi: Allow runtime relocation in library mode

Message ID 20260214021317.816170-7-sjg@u-boot.org
State New
Headers
Series ulib: Support building examples for x86 |

Commit Message

Simon Glass Feb. 14, 2026, 2:13 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

EFI runtime relocation is needed even when U-Boot runs in library mode,
so remove the early return that skips it when gd_ulib() is set.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 lib/efi_loader/efi_runtime.c | 4 ----
 1 file changed, 4 deletions(-)
  

Patch

diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index bd09d78d047..8c0301e3918 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -718,10 +718,6 @@  static __efi_runtime void efi_relocate_runtime_table(ulong offset)
 /* Relocate EFI runtime to uboot_reloc_base = offset */
 void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
 {
-	/* Skip EFI runtime relocation when running as a library */
-	if (gd_ulib())
-		return;
-
 	/*
 	 * Cache gd->relocaddr for use by the EFI runtime services after
 	 * the OS has taken over. On architectures where 'gd' is accessed