aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--scripts/Makefile.spl2
-rwxr-xr-xscripts/gen_ll_addressable_symbols.sh5
3 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index b4ae66b..8c84c22 100644
--- a/Makefile
+++ b/Makefile
@@ -1735,7 +1735,7 @@ u-boot-keep-syms-lto_c := $(patsubst %.o,%.c,$(u-boot-keep-syms-lto))
quiet_cmd_keep_syms_lto = KSL $@
cmd_keep_syms_lto = \
- NM=$(NM) $(srctree)/scripts/gen_ll_addressable_symbols.sh $^ >$@
+ $(srctree)/scripts/gen_ll_addressable_symbols.sh $(NM) $^ > $@
quiet_cmd_keep_syms_lto_cc = KSLCC $@
cmd_keep_syms_lto_cc = \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 5be1a9b..25a3e7f 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -459,7 +459,7 @@ u-boot-spl-keep-syms-lto_c := \
quiet_cmd_keep_syms_lto = KSL $@
cmd_keep_syms_lto = \
- NM=$(NM) $(srctree)/scripts/gen_ll_addressable_symbols.sh $^ >$@
+ $(srctree)/scripts/gen_ll_addressable_symbols.sh $(NM) $^ > $@
quiet_cmd_keep_syms_lto_cc = KSLCC $@
cmd_keep_syms_lto_cc = \
diff --git a/scripts/gen_ll_addressable_symbols.sh b/scripts/gen_ll_addressable_symbols.sh
index 3978a39..b8840dd 100755
--- a/scripts/gen_ll_addressable_symbols.sh
+++ b/scripts/gen_ll_addressable_symbols.sh
@@ -5,8 +5,11 @@
# Generate __ADDRESSABLE(symbol) for every linker list entry symbol, so that LTO
# does not optimize these symbols away
+# The expected parameter of this script is the command requested to have
+# the U-Boot symbols to parse, for example: $(NM) $(u-boot-main)
+
set -e
echo '#include <common.h>'
-$NM "$@" 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' | \
+$@ 2>/dev/null | grep -oe '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*' | \
sort -u | sed -e 's/^\(.*\)/extern char \1[];\n__ADDRESSABLE(\1);/'