Skip to content

Commit 946d462

Browse files
Carlos LlamasNicolas Schier
authored andcommitted
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: 93863f3 ("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>
1 parent 0f61b18 commit 946d462

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/check-function-names.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ ! -f "$objfile" ]; then
1313
exit 1
1414
fi
1515

16-
bad_symbols=$(nm "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)')
16+
bad_symbols=$(${NM:-nm} "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)')
1717

1818
if [ -n "$bad_symbols" ]; then
1919
echo "$bad_symbols" | while read -r sym; do

0 commit comments

Comments
 (0)