From 97b24d3d51a92cb8c0c1e1a74abf22fe1a1807a3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 19 Oct 2012 05:00:10 +0000 Subject: common: Add symbol handling for generic lists into Makefile This patch adds essential components for generation of the contents of the linker section that is used by the linker-generated array. All of the contents is held in a separate file, u-boot.lst, which is generated at runtime just before U-Boot is linked. The purpose of this code is to especially generate the appropriate boundary symbols around each subsection in the section carrying the linker-generated arrays. Obviously, the interim linker code for actual placement of the variables into the section is generated too. The generated file, u-boot.lst, is included into u-boot.lds via the linker INCLUDE directive in u-boot.lds . Adjustments are made in the Makefile and spl/Makefile so that the u-boot.lds and u-boot-spl.lds depend on their respective .lst files. Signed-off-by: Marek Vasut Cc: Joe Hershberger Cc: Mike Frysinger Acked-by: Joe Hershberger Tested-by: Joe Hershberger --- nand_spl/board/freescale/p1_p2_rdb/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nand_spl/board/freescale/p1_p2_rdb') diff --git a/nand_spl/board/freescale/p1_p2_rdb/Makefile b/nand_spl/board/freescale/p1_p2_rdb/Makefile index 43da3df157..e5388d89c8 100644 --- a/nand_spl/board/freescale/p1_p2_rdb/Makefile +++ b/nand_spl/board/freescale/p1_p2_rdb/Makefile @@ -32,6 +32,7 @@ include $(TOPDIR)/config.mk nandobj := $(OBJTREE)/nand_spl/ LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \ $(LDFLAGS) $(LDFLAGS_FINAL) AFLAGS += -DCONFIG_NAND_SPL @@ -61,8 +62,12 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds -Map $(nandobj)u-boot-spl.map \ -o $(nandobj)u-boot-spl -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ +# The following line expands into whole rule which generates $(LSTSCRIPT), +# the file containing u-boots LG-array linker section. This is included into +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file. +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS))) +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT) + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@ # create symbolic links for common files -- cgit v1.2.1