Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/71910 )
Change subject: arch/x86: Link ramstage in one step ......................................................................
arch/x86: Link ramstage in one step
We only use the bfd linker currently but partial linking is not supported by other linkers and is also a problem for LTO.
Change-Id: I3b23d86e604229262d7c762e23bb963a0e944b5d Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/arch/x86/Makefile.inc 1 file changed, 16 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/71910/1
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index d281037..323baa2 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -292,11 +292,9 @@
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) target-objcopy=-O elf32-i386 -B i386 -LD_MACHINE =-m elf_i386 endif ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_64),y) target-objcopy=-O elf64-x86-64 -B i386:x86-64 -LD_MACHINE =-m elf_x86_64 endif
ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) @@ -315,13 +313,9 @@ $(objcbfs)/ramstage.elf: $(objcbfs)/ramstage.debug.rmod cp $< $@
-$(objcbfs)/ramstage.debug: $(objgenerated)/ramstage.o $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) - @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) $(CPPFLAGS) $(LDFLAGS_ramstage) -o $@ -L$(obj) $< -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) - -$(objgenerated)/ramstage.o: $$(ramstage-objs) $(COMPILER_RT_ramstage) $$(ramstage-libs) - @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) $(LD_MACHINE) -r -o $@ $(COMPILER_RT_FLAGS_ramstage) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) $(ramstage-libs) --no-whole-archive $(COMPILER_RT_ramstage) --end-group +$(objcbfs)/ramstage.debug: $$(ramstage-objs) $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) $$(ramstage-libs) + @printf " LINK $(subst $(obj)/,,$(@))\n" + $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_ramstage) --whole-archive --start-group $(filter-out %.ld,$^) --no-whole-archive $(COMPILER_RT_ramstage) --end-group -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE))
endif # CONFIG_ARCH_RAMSTAGE_X86_32 / CONFIG_ARCH_RAMSTAGE_X86_64