diff options
| author | Carlos Llamas <cmllamas@google.com> | 2025-12-18 20:58:06 +0300 |
|---|---|---|
| committer | Nicolas Schier <nsc@kernel.org> | 2026-01-14 16:13:41 +0300 |
| commit | 946d462346d2ded161cfd3dc62a61d7050d9f9ec (patch) | |
| tree | 62b8e65ec1fc849c220b9c0ea6512468ff0a8b23 /scripts | |
| parent | 0f61b1860cc3f52aef9036d7235ed1f017632193 (diff) | |
| download | linux-946d462346d2ded161cfd3dc62a61d7050d9f9ec.tar.xz | |
kbuild: prefer ${NM} in check-function-names.sh
The check-function-names.sh scripts invokes 'nm' directly and this can
be problematic during cross-compilation when the toolchain is different
from the system's default (e.g. LLVM=1).
scripts/check-function-names.sh: nm: not found
Let's prefer the ${NM} variable which is already set by kbuild. However,
still fallback to plain 'nm' to ensure the script is still usable when
called directly.
Fixes: 93863f3f859a ("kbuild: Check for functions with ambiguous -ffunction-sections section names")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20251218175824.3122690-1-cmllamas@google.com
Signed-off-by: Nicolas Schier <nsc@kernel.org>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-function-names.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/check-function-names.sh b/scripts/check-function-names.sh index 410042591cfc..08071133e5a5 100755 --- a/scripts/check-function-names.sh +++ b/scripts/check-function-names.sh @@ -13,7 +13,7 @@ if [ ! -f "$objfile" ]; then exit 1 fi -bad_symbols=$(nm "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)') +bad_symbols=$(${NM:-nm} "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)') if [ -n "$bad_symbols" ]; then echo "$bad_symbols" | while read -r sym; do |
