Alexandru Gagniuc (mr.nuke.me@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11781
-gerrit
commit e2a1169177927734172f90cad32c2991f8e98680 Author: Alexandru Gagniuc mr.nuke.me@gmail.com Date: Fri Oct 2 10:59:13 2015 -0700
x86/bootblock: Use LDFLAGS_bootblock to enable garbage collection
The x86 bootblock linking is a mess. The bootblock is treated in a very special manner, and never received the update to link-time garbage collection.
On newer x86 platforms, the boot media is no longer memory-mapped. That means we need to do a lot more setup in the bootblock. ROMCC is unsuitable for this task, and walkcbfs only works on memory-mapped CBFS. We need to revise the x86 bootflow for this new case.
The approach this patch series takes is to perform CAR setup in the bootblock, and load the following stage (either romstage or verstage) from the boot media. This approach is not new, but has been done on our ARM ports for years.
Since we will be adding .c files to the bootblock, it is prudent to use link-time garbage collection. This is also consistent to how we do things on other architectures. Unification FTW!
Change-Id: I16b78456df56e0053984a9aca9367e2542adfdc9 Signed-off-by: Alexandru Gagniuc mr.nuke.me@gmail.com --- src/arch/x86/Makefile.inc | 4 ++-- src/arch/x86/id.ld | 2 +- src/cpu/intel/fit/fit.ld | 2 +- src/cpu/x86/16bit/reset16.ld | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index f16edcd..1bda5f6 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -106,9 +106,9 @@ $(objgenerated)/bootblock.inc: $(src)/arch/x86/$(subst ",,$(CONFIG_BOOTBLOCK_SOU $(objcbfs)/bootblock.debug: $(obj)/arch/x86/bootblock.bootblock.o $(obj)/arch/x86/bootblock.bootblock.ld @printf " LINK $(subst $(obj)/,,$(@))\n" ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32),y) - $(LD_bootblock) -m elf_i386 --oformat elf32-i386 -static -o $@ -L$(obj) $< -T $(obj)/arch/x86/bootblock.bootblock.ld + $(LD_bootblock) $(LDFLAGS_common) -m elf_i386 --oformat elf32-i386 -static -o $@ -L$(obj) $< -T $(obj)/arch/x86/bootblock.bootblock.ld else - $(LD_bootblock) -m elf_x86_64 --oformat elf64-x86-64 -static -o $@ -L$(obj) $< -T $(obj)/arch/x86/bootblock.bootblock.ld + $(LD_bootblock) $(LDFLAGS_common) -m elf_x86_64 --oformat elf64-x86-64 -static -o $@ -L$(obj) $< -T $(obj)/arch/x86/bootblock.bootblock.ld endif
diff --git a/src/arch/x86/id.ld b/src/arch/x86/id.ld index cfd091d..99d13f1 100644 --- a/src/arch/x86/id.ld +++ b/src/arch/x86/id.ld @@ -1,6 +1,6 @@ SECTIONS { . = (0xffffffff - CONFIG_ID_SECTION_OFFSET) - (__id_end - __id_start) + 1; .id (.): { - *(.id) + KEEP(*(.id)) } } diff --git a/src/cpu/intel/fit/fit.ld b/src/cpu/intel/fit/fit.ld index 9ccfe82..5817e1d 100644 --- a/src/cpu/intel/fit/fit.ld +++ b/src/cpu/intel/fit/fit.ld @@ -1,6 +1,6 @@ SECTIONS { . = 0xffffffc0; .fit_pointer (.): { - *(.fit_pointer) + KEEP(*(.fit_pointer)) } } diff --git a/src/cpu/x86/16bit/reset16.ld b/src/cpu/x86/16bit/reset16.ld index a31a580..d0c4096 100644 --- a/src/cpu/x86/16bit/reset16.ld +++ b/src/cpu/x86/16bit/reset16.ld @@ -9,7 +9,7 @@ SECTIONS { _ROMTOP = 0xfffffff0; . = _ROMTOP; .reset . : { - *(.reset) + KEEP(*(.reset)); . = 15 ; BYTE(0x00); }