From ae24286b49e5d98feb817a10e1d247240cd43552 Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Wed, 3 Feb 2021 14:19:30 +0000 Subject: [PATCH] FROMGIT: asm-generic: export: Stub EXPORT_SYMBOL with __DISABLE_EXPORTS It is currently possible to stub EXPORT_SYMBOL() macros in C code using __DISABLE_EXPORTS, which is necessary to run in constrained environments such as the EFI stub or the decompressor. But this currently doesn't apply to exports from assembly, which can lead to somewhat confusing situations. Consolidate the __DISABLE_EXPORTS infrastructure by checking it from asm-generic/export.h as well. Signed-off-by: Quentin Perret Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210203141931.615898-2-qperret@google.com (cherry picked from commit 54effa653246c35997f5e990e0134be5be09f9d1 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next) Signed-off-by: Will Deacon Change-Id: I31d29e667d73f125b2de77247b6115c407e763b3 Bug: 178098380 Test: atest VirtualizationHostTestCases on an EL2-enabled device --- include/asm-generic/export.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/export.h b/include/asm-generic/export.h index 365345f9a9e3..07a36a874dca 100644 --- a/include/asm-generic/export.h +++ b/include/asm-generic/export.h @@ -33,7 +33,7 @@ */ .macro ___EXPORT_SYMBOL name,val,sec -#ifdef CONFIG_MODULES +#if defined(CONFIG_MODULES) && !defined(__DISABLE_EXPORTS) .section ___ksymtab\sec+\name,"a" .balign KSYM_ALIGN __ksymtab_\name: