Commit 97b24d3d51a92cb8c0c1e1a74abf22fe1a1807a3

Authored by Marek Vasut
Committed by Tom Rini
1 parent 047cea3655

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 <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Joe Hershberger <joe.hershberger@ni.com>

Showing 15 changed files with 152 additions and 25 deletions Side-by-side Diff

... ... @@ -38,6 +38,7 @@
38 38 /u-boot.sha1
39 39 /u-boot.dis
40 40 /u-boot.lds
  41 +/u-boot.lst
41 42 /u-boot.ubl
42 43 /u-boot.ais
43 44 /u-boot.dtb
... ... @@ -535,7 +535,10 @@
535 535 GEN_UBOOT = \
536 536 UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
537 537 sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
538   - cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \
  538 + UNDEF_LST=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
  539 + sed -n -e 's/.*\($(SYM_PREFIX)_u_boot_list_.*\)/-u\1/p'|sort|uniq`;\
  540 + cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
  541 + $$UNDEF_SYM $$UNDEF_LST $(__OBJS) \
539 542 --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
540 543 -Map u-boot.map -o u-boot
541 544 endif
... ... @@ -568,8 +571,12 @@
568 571 $(LDSCRIPT): depend
569 572 $(MAKE) -C $(dir $@) $(notdir $@)
570 573  
571   -$(obj)u-boot.lds: $(LDSCRIPT)
572   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  574 +# The following line expands into whole rule which generates u-boot.lst,
  575 +# the file containing u-boots LG-array linker section. This is included into
  576 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  577 +$(eval $(call make_u_boot_list, $(obj)include/u-boot.lst, $(LIBBOARD) $(LIBS)))
  578 +$(obj)u-boot.lds: $(LDSCRIPT) $(obj)include/u-boot.lst
  579 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
573 580  
574 581 nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend
575 582 $(MAKE) -C nand_spl/board/$(BOARDDIR) all
... ... @@ -808,6 +815,7 @@
808 815 $(obj)board/matrix_vision/*/bootscript.img \
809 816 $(obj)board/voiceblue/eeprom \
810 817 $(obj)u-boot.lds \
  818 + $(obj)include/u-boot.lst \
811 819 $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs] \
812 820 $(obj)arch/blackfin/cpu/init.{lds,elf}
813 821 @rm -f $(obj)include/bmp_logo.h
... ... @@ -841,8 +849,10 @@
841 849 @rm -f $(obj)u-boot.dtb
842 850 @rm -f $(obj)u-boot.sb
843 851 @rm -f $(obj)u-boot.spr
844   - @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
845   - @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
  852 + @rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map}
  853 + @rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
  854 + @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
  855 + @rm -f $(obj)spl/{u-boot-spl.lds,u-boot.lst}
846 856 @rm -f $(obj)MLO
847 857 @rm -f $(obj)tools/xway-swap-bytes
848 858 @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
... ... @@ -23,6 +23,8 @@
23 23  
24 24 #########################################################################
25 25  
  26 +include $(TOPDIR)/helper.mk
  27 +
26 28 ifeq ($(CURDIR),$(SRCTREE))
27 29 dir :=
28 30 else
  1 +#
  2 +# Copyright (C) 2012 Marek Vasut <marex@denx.de>
  3 +#
  4 +# See file CREDITS for list of people who contributed to this
  5 +# project.
  6 +#
  7 +# This program is free software; you can redistribute it and/or
  8 +# modify it under the terms of the GNU General Public License as
  9 +# published by the Free Software Foundation; either version 2 of
  10 +# the License, or (at your option) any later version.
  11 +#
  12 +#########################################################################
  13 +
  14 +##
  15 +# make_u_boot_list - Generate contents of u_boot_list section
  16 +# 1: The name of the resulting file (usually u-boot.lst)
  17 +# 2: Files to analyze for possible u_boot_list entries
  18 +#
  19 +# This function generates the contents of the u_boot_list section,
  20 +# including all the border symbols for it's subsections. The operation
  21 +# of this function is as follows, numbering goes per lines:
  22 +#
  23 +# 1) Dump the ELF header sections from all files supplied via $(2)
  24 +# 2) Filter out all other stuff that does not belong into .u_boot_list
  25 +# section.
  26 +# 3) Fix up the lines so that the resulting output is is in format
  27 +# ".u_boot_list.*".
  28 +# 4) Remove the last .something$, since that only contains the name
  29 +# of the variable to be put into a subsection. This name is irelevant
  30 +# for generation of border symbols, thus of no interest, remove it.
  31 +# 5) Take each line and for every dot "." in that line, print the whole
  32 +# line until that dot "." . This is important so that we have all
  33 +# parent border symbols generated as well.
  34 +# 6) Load every line and firstly append "\a" at the end and print the
  35 +# line. Next, append "@" at the end and print the line. Finally,
  36 +# append "~" at the end of line. This will make sense in conjunction
  37 +# with 6) and 7).
  38 +# 7) Sort the lines. It is imperative to use LC_COLLATE=C here because
  39 +# with this, the "\a" symbol is first and "~" symbol is last. Any
  40 +# other symbols fall inbetween. Symbols like "@", which marks the
  41 +# end of current line (representing current section) and ".", which
  42 +# means the line continues and thus represents subsection.
  43 +# 8) With such ordering, all lines ending with "\a" will float at the
  44 +# begining of all lines with the same prefix. Thus it is easy to
  45 +# replace "\a" with __start and make it the __start border symbol.
  46 +# Very similarly for "~", which will be always at the bottom and so
  47 +# can be replaced by "__end" and made into the __end border symbol.
  48 +# Finally, every line ending with "@" symbol will be transformed
  49 +# into " *(SORT(${line}*)); " format, which in the linker parlance
  50 +# will allow it to trap all symbols relevant to the subsection.
  51 +#
  52 +define make_u_boot_list
  53 +$(1): $(2)
  54 + $(OBJDUMP) -h $(2) | \
  55 + sed -n -e '/.*\.u_boot_list[^ ]\+/ ! {d;n}' \
  56 + -e 's/.*\(\.u_boot_list[^ ]\+\).*$$$$/\1/' \
  57 + -e 's/\.[^\.]\+$$$$//' \
  58 + -e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
  59 + sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
  60 + LC_COLLATE=C sort -u | \
  61 + sed -n -e '/\a$$$$/ { s/\./_/g;s/\a$$$$/__start = .;/p; }'\
  62 + -e '/~$$$$/ { s/\./_/g;s/~$$$$/__end = .;/p; }'\
  63 + -e '/@$$$$/ { s/\(.*\)@$$$$/*(SORT(\1.*));/p }' > $(1)
  64 +endef
nand_spl/board/freescale/mpc8536ds/Makefile
... ... @@ -32,6 +32,7 @@
32 32 nandobj := $(OBJTREE)/nand_spl/
33 33  
34 34 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  35 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
35 36 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
36 37 $(LDFLAGS) $(LDFLAGS_FINAL)
37 38 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -61,8 +62,12 @@
61 62 -Map $(nandobj)u-boot-spl.map \
62 63 -o $(nandobj)u-boot-spl
63 64  
64   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
65   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  65 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  66 +# the file containing u-boots LG-array linker section. This is included into
  67 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  68 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  69 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  70 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
66 71  
67 72 # create symbolic links for common files
68 73  
nand_spl/board/freescale/mpc8569mds/Makefile
... ... @@ -32,6 +32,7 @@
32 32 nandobj := $(OBJTREE)/nand_spl/
33 33  
34 34 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  35 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
35 36 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
36 37 $(LDFLAGS) $(LDFLAGS_FINAL)
37 38 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -61,8 +62,12 @@
61 62 -Map $(nandobj)u-boot-spl.map \
62 63 -o $(nandobj)u-boot-spl
63 64  
64   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
65   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  65 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  66 +# the file containing u-boots LG-array linker section. This is included into
  67 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  68 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  69 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  70 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
66 71  
67 72 # create symbolic links for common files
68 73  
nand_spl/board/freescale/mpc8572ds/Makefile
... ... @@ -32,6 +32,7 @@
32 32 nandobj := $(OBJTREE)/nand_spl/
33 33  
34 34 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  35 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
35 36 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
36 37 $(LDFLAGS) $(LDFLAGS_FINAL)
37 38 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -61,8 +62,12 @@
61 62 -Map $(nandobj)u-boot-spl.map \
62 63 -o $(nandobj)u-boot-spl
63 64  
64   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
65   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  65 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  66 +# the file containing u-boots LG-array linker section. This is included into
  67 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  68 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  69 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  70 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
66 71  
67 72 # create symbolic links for common files
68 73  
nand_spl/board/freescale/mx31pdk/Makefile
... ... @@ -6,6 +6,7 @@
6 6 nandobj := $(OBJTREE)/nand_spl/
7 7  
8 8 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
  9 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
9 10 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
10 11 $(LDFLAGS_FINAL)
11 12 AFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
... ... @@ -36,8 +37,12 @@
36 37 -Map $(nandobj)u-boot-spl.map \
37 38 -o $@
38 39  
39   -$(nandobj)u-boot.lds: $(LDSCRIPT)
40   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  40 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  41 +# the file containing u-boots LG-array linker section. This is included into
  42 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  43 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  44 +$(nandobj)u-boot.lds: $(LDSCRIPT) $(LSTSCRIPT)
  45 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
41 46  
42 47 #########################################################################
43 48  
nand_spl/board/freescale/p1010rdb/Makefile
... ... @@ -32,6 +32,7 @@
32 32 nandobj := $(OBJTREE)/nand_spl/
33 33  
34 34 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  35 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
35 36 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS) \
36 37 $(LDFLAGS_FINAL)
37 38 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -62,8 +63,12 @@
62 63 -Map $(nandobj)u-boot-spl.map \
63 64 -o $(nandobj)u-boot-spl
64 65  
65   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
66   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  66 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  67 +# the file containing u-boots LG-array linker section. This is included into
  68 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  69 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  70 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  71 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
67 72  
68 73 # create symbolic links for common files
69 74  
nand_spl/board/freescale/p1023rds/Makefile
... ... @@ -27,6 +27,7 @@
27 27 nandobj := $(OBJTREE)/nand_spl/
28 28  
29 29 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  30 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
30 31 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
31 32 $(LDFLAGS) $(LDFLAGS_FINAL)
32 33 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -57,8 +58,12 @@
57 58 -Map $(nandobj)u-boot-spl.map \
58 59 -o $(nandobj)u-boot-spl
59 60  
60   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
61   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  61 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  62 +# the file containing u-boots LG-array linker section. This is included into
  63 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  64 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  65 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  66 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
62 67  
63 68 # create symbolic links for common files
64 69  
nand_spl/board/freescale/p1_p2_rdb/Makefile
... ... @@ -32,6 +32,7 @@
32 32 nandobj := $(OBJTREE)/nand_spl/
33 33  
34 34 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  35 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
35 36 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
36 37 $(LDFLAGS) $(LDFLAGS_FINAL)
37 38 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -61,8 +62,12 @@
61 62 -Map $(nandobj)u-boot-spl.map \
62 63 -o $(nandobj)u-boot-spl
63 64  
64   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
65   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  65 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  66 +# the file containing u-boots LG-array linker section. This is included into
  67 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  68 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  69 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  70 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
66 71  
67 72 # create symbolic links for common files
68 73  
nand_spl/board/freescale/p1_p2_rdb_pc/Makefile
... ... @@ -32,6 +32,7 @@
32 32 nandobj := $(OBJTREE)/nand_spl/
33 33  
34 34 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  35 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
35 36 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
36 37 $(LDFLAGS) $(LDFLAGS_FINAL)
37 38 AFLAGS += -DCONFIG_NAND_SPL
... ... @@ -62,8 +63,12 @@
62 63 -Map $(nandobj)u-boot-spl.map \
63 64 -o $(nandobj)u-boot-spl
64 65  
65   -$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
66   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  66 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  67 +# the file containing u-boots LG-array linker section. This is included into
  68 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  69 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  70 +$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
  71 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
67 72  
68 73 # create symbolic links for common files
69 74  
nand_spl/board/karo/tx25/Makefile
... ... @@ -27,6 +27,7 @@
27 27 nandobj := $(OBJTREE)/nand_spl/
28 28  
29 29 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
  30 +LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
30 31 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
31 32 $(LDFLAGS_FINAL)
32 33 AFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
... ... @@ -57,8 +58,12 @@
57 58 -Map $(nandobj)u-boot-spl.map \
58 59 -o $@
59 60  
60   -$(nandobj)u-boot.lds: $(LDSCRIPT)
61   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  61 +# The following line expands into whole rule which generates $(LSTSCRIPT),
  62 +# the file containing u-boots LG-array linker section. This is included into
  63 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  64 +$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
  65 +$(nandobj)u-boot.lds: $(LDSCRIPT) $(LSTSCRIPT)
  66 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
62 67  
63 68 #########################################################################
64 69  
... ... @@ -2,4 +2,5 @@
2 2 u-boot-spl.bin
3 3 u-boot-spl.lds
4 4 u-boot-spl.map
  5 +u-boot.lst
... ... @@ -154,8 +154,12 @@
154 154 $(LIBS): depend
155 155 $(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
156 156  
157   -$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
158   - $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
  157 +# The following line expands into whole rule which generates u-boot.lst,
  158 +# the file containing u-boots LG-array linker section. This is included into
  159 +# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
  160 +$(eval $(call make_u_boot_list, $(obj)u-boot.lst, $(LIBS)))
  161 +$(obj)u-boot-spl.lds: $(LDSCRIPT) $(obj)u-boot.lst depend
  162 + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj). -ansi -D__ASSEMBLY__ -P - < $< > $@
159 163  
160 164 depend: $(obj).depend
161 165 .PHONY: depend