mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
To reduce code duplication, make sure STAGE2_OBJ does not contain
any object already mentioned in STAGE0_OBJ. This saves 386 bytes in qemu stage2 (~240 bytes after LZMA compression). Build tested and runtime tested in Qemu. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@540 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
29aef7a30f
commit
91b0dd0974
1 changed files with 7 additions and 2 deletions
|
@ -198,11 +198,16 @@ endif
|
|||
STAGE2_OBJ += $(obj)/util/x86emu/libx86emu.a $(LIBGCC_FILE_NAME)
|
||||
endif
|
||||
|
||||
$(obj)/linuxbios.stage2 $(obj)/linuxbios.stage2.map: $(obj)/stage0.init $(STAGE2_OBJ)
|
||||
# To reduce code duplication, always make sure STAGE2_OBJ does not contain
|
||||
# any object from STAGE0_OBJ.
|
||||
|
||||
STAGE2_OBJ_NEEDED = $(filter-out $(STAGE0_OBJ), $(STAGE2_OBJ))
|
||||
|
||||
$(obj)/linuxbios.stage2 $(obj)/linuxbios.stage2.map: $(obj)/stage0.init $(STAGE2_OBJ_NEEDED)
|
||||
$(Q)# leave a .o with full symbols in it for debugging.
|
||||
$(Q)printf " LD $(subst $(shell pwd)/,,$(@))\n"
|
||||
$(Q)$(LD) -R $(obj)/stage0.o -Ttext 0x1000 --entry=stage2 \
|
||||
-o $(obj)/linuxbios.stage2 $(STAGE2_OBJ)
|
||||
-o $(obj)/linuxbios.stage2 $(STAGE2_OBJ_NEEDED)
|
||||
$(Q)$(NM) $(obj)/linuxbios.stage2 | sort -u > $(obj)/linuxbios.stage2.map
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue