Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efi/libstub: move efi_system_table global var into separate object

To avoid pulling in the wrong object when using the libstub static
library to build the decompressor, define efi_system_table in a separate
compilation unit.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

+10 -3
+2 -1
drivers/firmware/efi/libstub/Makefile
··· 66 66 $(call if_changed_rule,cc_o_c) 67 67 68 68 lib-$(CONFIG_EFI_GENERIC_STUB) += efi-stub.o fdt.o string.o intrinsics.o \ 69 - $(patsubst %.c,lib-%.o,$(efi-deps-y)) 69 + $(patsubst %.c,lib-%.o,$(efi-deps-y)) \ 70 + systable.o 70 71 71 72 lib-$(CONFIG_ARM) += arm32-stub.o 72 73 lib-$(CONFIG_ARM64) += arm64-stub.o
-2
drivers/firmware/efi/libstub/efi-stub.c
··· 57 57 static u64 virtmap_base = EFI_RT_VIRTUAL_BASE; 58 58 static bool flat_va_mapping = (EFI_RT_VIRTUAL_OFFSET != 0); 59 59 60 - const efi_system_table_t *efi_system_table; 61 - 62 60 static struct screen_info *setup_graphics(void) 63 61 { 64 62 efi_guid_t gop_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
+8
drivers/firmware/efi/libstub/systable.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <linux/efi.h> 4 + #include <asm/efi.h> 5 + 6 + #include "efistub.h" 7 + 8 + const efi_system_table_t *efi_system_table;