diff options
Diffstat (limited to 'src/cpu/ti/am335x/Makefile.inc')
-rw-r--r-- | src/cpu/ti/am335x/Makefile.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cpu/ti/am335x/Makefile.inc b/src/cpu/ti/am335x/Makefile.inc index c1bbcf6ce7..7dcdf0f77a 100644 --- a/src/cpu/ti/am335x/Makefile.inc +++ b/src/cpu/ti/am335x/Makefile.inc @@ -17,9 +17,17 @@ real-target: $(obj)/MLO header_ld = $(src)/cpu/ti/am335x/header.ld -$(obj)/omap-header.bin: $$(omap-header-objs) $$(header_ld) +get_header_size=$(shell $(CBFSTOOL) $(1) print | grep $(2) | awk '{print $$2 + $$4}') + +$(obj)/omap-header.bin: $$(omap-header-objs) $$(header_ld) $(obj)/coreboot.rom @printf " CC $(subst $(obj)/,,$(@))\n" - $(CC) -nostdlib -nostartfiles -static -include $(obj)/config.h -o $@.tmp $< -T $(header_ld) + $(CC) -nostdlib -nostartfiles -static -include $(obj)/config.h \ + -Wl,--defsym,header_load_size=$(strip \ + $(call get_header_size,$(obj)/coreboot.rom, \ + $(CONFIG_CBFS_PREFIX)/romstage \ + ) \ + ) \ + -o $@.tmp $< -T $(header_ld) $(OBJCOPY) --only-section=".header" -O binary $@.tmp $@ $(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin |