summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-07-29 12:10:23 -0400
committerTom Rini <[email protected]>2021-07-29 12:10:55 -0400
commit15f7e0dc01d8a851fb1bfbf0e47eab5b67ed26b3 (patch)
treea05518590771cfaff996f35856b9d9d8edfa7221 /scripts
parent38436abd5e58044eccddbcd7ec3610a9104e86b6 (diff)
parent62b27a561c2868d95445905ad554297e43cc0f2b (diff)
Merge branch '2021-07-28-assorted-fixes'
- Assorted bugfixes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.spl2
-rwxr-xr-xscripts/gen_ll_addressable_symbols.sh5
2 files changed, 5 insertions, 2 deletions
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 5be1a9ba1b1..25a3e7fa52e 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 3978a39d970..b8840dd0113 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);/'