Makefile.inc: Add separate bootblock.raw.elf with allocatable BSS
This patch moves the objcopy invocation that changes the bootblock's section flags to make sure .data and .bss are preserved in the binary image from the generation of bootblock.raw.bin into a separate bootblock.raw.elf file. Some SoCs (like SDM845) like to have an ELF rather than a raw binary as input to their masked ROM wrapper generation script. Also move those objcopy flags out into a variable because I'll need them again in a later patch. Change-Id: I9557b184df7f753a442c7e0ceb58e81c5e19f2c5 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/26338 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
88f4e08acf
commit
1ca26664e6
13
Makefile.inc
13
Makefile.inc
|
@ -623,11 +623,16 @@ find-class = $(if $(filter $(1),$(basename $(1))),$(if $(CC_$(1)), $(1), $(call
|
||||||
# include the bss section in the binary so the BootROM clears the bss on
|
# include the bss section in the binary so the BootROM clears the bss on
|
||||||
# loading of the bootblock stage. Achieve this by marking the bss section
|
# loading of the bootblock stage. Achieve this by marking the bss section
|
||||||
# loadable,allocatable, and data. Do the same for the .data section in case
|
# loadable,allocatable, and data. Do the same for the .data section in case
|
||||||
# it's marked as NOBITS.
|
# the linker marked it NOBITS automatically because there are only zeroes in it.
|
||||||
$(objcbfs)/bootblock.raw.bin: $(objcbfs)/bootblock.elf
|
preserve-bss-flags := --set-section-flags .bss=load,alloc,data --set-section-flags .data=load,alloc,data
|
||||||
|
|
||||||
|
$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
|
||||||
@printf " OBJCOPY $(notdir $(@))\n"
|
@printf " OBJCOPY $(notdir $(@))\n"
|
||||||
$(OBJCOPY_bootblock) --set-section-flags .bss=load,alloc,data --set-section-flags .data=load,alloc,data $< $<.tmp
|
$(OBJCOPY_bootblock) $(preserve-bss-flags) $< $@
|
||||||
$(OBJCOPY_bootblock) -O binary $<.tmp $@
|
|
||||||
|
$(objcbfs)/bootblock.raw.bin: $(objcbfs)/bootblock.raw.elf
|
||||||
|
@printf " OBJCOPY $(notdir $(@))\n"
|
||||||
|
$(OBJCOPY_bootblock) -O binary $< $@
|
||||||
|
|
||||||
$(objcbfs)/%.bin: $(objcbfs)/%.raw.bin
|
$(objcbfs)/%.bin: $(objcbfs)/%.raw.bin
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
Loading…
Reference in New Issue