summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorPetr Cvek <petrcvekcz@gmail.com>2022-07-13 05:23:15 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-07-14 12:45:03 +0000
commit552c052a94922a7a898e21cf1760d74d23d8b95b (patch)
tree87f19dd0b156f87ffcbf3e34151f767f7617f095 /Makefile.inc
parent97b0cf774d84c164b32784209c4f6bf5fdfc70ad (diff)
Makefile.inc: objcopy extracts a wrong section of cbfs_master_header
Commit 75226bb879837 ("Makefile.inc: Generate master header and pointer as C structs") may cause objcopy to copy a wrong section of object file resulting in miscompiled image with missing CBFS master header. This makes the usage of secondary payloads impossible. For example a wrong section for CONFIG_ANY_TOOLCHAIN + objcopy 2.38-slack151 will copy ".note.gnu.property". This patch constraints the sections to .data and .bss only. Signed-off-by: Petr Cvek <petrcvekcz@gmail.com> Change-Id: I1b9a73ece7067c9c5100cb294775078f838e263b Reviewed-on: https://review.coreboot.org/c/coreboot/+/65808 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile.inc b/Makefile.inc
index de8c734f2a..8d3e8fcf22 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -343,7 +343,7 @@ 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 --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)