Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80735?usp=email )
Change subject: lib: Declare heap in assembly ......................................................................
lib: Declare heap in assembly
Some linkers like LLD don't set up the NOBITS flag on the .heap section when just declaring that region in the linker script. This would have the program loader initialize the heap, which is not desirable for performance reasons. Also if the cbfs file would not be compressed it would be huge as the default heap is 1M.
Change-Id: I3ca7221d10f144f608823e0b9624533780fbf335 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/lib/Makefile.mk M src/lib/program.ld 2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/80735/1
diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk index c5e4278..bd5363a 100644 --- a/src/lib/Makefile.mk +++ b/src/lib/Makefile.mk @@ -140,6 +140,7 @@ ramstage-y += memchr.c ramstage-y += memcmp.c ramstage-y += malloc.c +ramstage-y += heap.S ramstage-y += dimm_info_util.c ramstage-y += delay.c ramstage-y += fallback_boot.c diff --git a/src/lib/program.ld b/src/lib/program.ld index 6d72d9e..bdcadca 100644 --- a/src/lib/program.ld +++ b/src/lib/program.ld @@ -131,12 +131,11 @@ #endif
#if ENV_HAS_HEAP_SECTION -.heap . (NOLOAD) : { +.heap . : { . = ALIGN(ARCH_POINTER_ALIGN_SIZE); - _heap = .; - . += CONFIG_HEAP_SIZE; + *(.heap) + *(.heap.*) . = ALIGN(ARCH_POINTER_ALIGN_SIZE); - _eheap = .; RECORD_SIZE(heap) } #endif