Skip to content

Commit 771856c

Browse files
mcgrofgregkh
authored andcommitted
vmlinux.lds.h: wrap built-in firmware support under FW_LOADER
The firmware loader built-in firmware is only available when FW_LOADER is built-in, so tuck away the sections for built-in firmware under it. This ensures no oddball user tries to uses these sections without first enabling FW_LOADER=y. Reviewed-by: Borislav Petkov <bp@suse.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20211021155843.1969401-6-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e2e2c0f commit 771856c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

include/asm-generic/vmlinux.lds.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,7 @@
470470
__end_pci_fixups_suspend_late = .; \
471471
} \
472472
\
473-
/* Built-in firmware blobs */ \
474-
.builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) { \
475-
__start_builtin_fw = .; \
476-
KEEP(*(.builtin_fw)) \
477-
__end_builtin_fw = .; \
478-
} \
479-
\
473+
FW_LOADER_BUILT_IN_DATA \
480474
TRACEDATA \
481475
\
482476
PRINTK_INDEX \
@@ -880,6 +874,18 @@
880874
#define ORC_UNWIND_TABLE
881875
#endif
882876

877+
/* Built-in firmware blobs */
878+
#ifdef CONFIG_FW_LOADER
879+
#define FW_LOADER_BUILT_IN_DATA \
880+
.builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) { \
881+
__start_builtin_fw = .; \
882+
KEEP(*(.builtin_fw)) \
883+
__end_builtin_fw = .; \
884+
}
885+
#else
886+
#define FW_LOADER_BUILT_IN_DATA
887+
#endif
888+
883889
#ifdef CONFIG_PM_TRACE
884890
#define TRACEDATA \
885891
. = ALIGN(4); \

0 commit comments

Comments
 (0)