Makefile.inc: Alloc .bss* sections for "struct" file type
When the global variable of a "struct" CBFS file is zero (for example, CB:47696), the binary will appear in the .bss* section in the ELF file (instead of .data). This results in an empty binary file added to CBFS, so that file size check will fail when reading it at runtime. BUG=b:173751635 TEST=emerge-asurada coreboot TEST=Check sdram-lpddr4x-KMDP6001DA-B425-4GB is non-empty in CBFS BRANCH=none Change-Id: Idfd17d10101a948de0eb0522a672afd5c2f83b04 Signed-off-by: Yu-Ping Wu <yupingso@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47903 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
679b236bed
commit
3c729487bf
|
@ -338,7 +338,7 @@ cbfs-files-processor-struct= \
|
||||||
$(eval $(2): $(1) $(obj)/build.h $(KCONFIG_AUTOHEADER); \
|
$(eval $(2): $(1) $(obj)/build.h $(KCONFIG_AUTOHEADER); \
|
||||||
printf " CC+STRIP $(@)\n"; \
|
printf " CC+STRIP $(@)\n"; \
|
||||||
$(CC_ramstage) -MMD $(CPPFLAGS_ramstage) $(CFLAGS_ramstage) $$(ramstage-c-ccopts) -include $(KCONFIG_AUTOHEADER) -MT $(2) -o $(2).tmp -c $(1) && \
|
$(CC_ramstage) -MMD $(CPPFLAGS_ramstage) $(CFLAGS_ramstage) $$(ramstage-c-ccopts) -include $(KCONFIG_AUTOHEADER) -MT $(2) -o $(2).tmp -c $(1) && \
|
||||||
$(OBJCOPY_ramstage) -O binary $(2).tmp $(2); \
|
$(OBJCOPY_ramstage) -O binary --set-section-flags .bss*=alloc,contents,load $(2).tmp $(2); \
|
||||||
rm -f $(2).tmp) \
|
rm -f $(2).tmp) \
|
||||||
$(eval DEPENDENCIES += $(2).d)
|
$(eval DEPENDENCIES += $(2).d)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue