From a24d002ac2b409788bb8cd53725f482c427ca232 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 8 Apr 2024 02:13:11 +0200 Subject: [PATCH] Makefile.mk: Account for large code model sections in cbfs_struct Starting with version 18 LLVM puts code and data generated with -ffunction-section -mcmodel=large inside sections with an 'l' prefix. This would now also pick up const data in .rodata. Change-Id: Ie07779ef548337772183ffe2d642f971d8cceae7 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/81777 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- Makefile.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.mk b/Makefile.mk index d7110a9caa..e642ac7a6e 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -366,7 +366,8 @@ cbfs-files-processor-struct= \ $(eval $(2): $(1) $(obj)/build.h $(obj)/fmap_config.h $(KCONFIG_AUTOHEADER); \ printf " CC+STRIP $(1)\n"; \ $(CC_ramstage) -MMD $(CPPFLAGS_ramstage) $(CFLAGS_ramstage) --param asan-globals=0 $$(ramstage-c-ccopts) -include $(KCONFIG_AUTOHEADER) -MT $(2) -o $(2).tmp -c $(1) && \ - $(OBJCOPY_ramstage) -O binary --only-section='.data*' --only-section='.bss*' --set-section-flags .bss*=alloc,contents,load $(2).tmp $(2); \ + $(OBJCOPY_ramstage) -O binary --only-section='.*data*' --only-section='.*bss*' \ + --set-section-flags .*bss*=alloc,contents,load $(2).tmp $(2); \ rm -f $(2).tmp) \ $(eval DEPENDENCIES += $(2).d)