diff options
| author | John Wang <wangzq.jn@gmail.com> | 2025-03-28 15:38:02 +0800 |
|---|---|---|
| committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2025-10-14 14:45:20 -0700 |
| commit | 567f9c428f99560fe14e647def9f42f5344ebde9 (patch) | |
| tree | 0ccebc50c52b7a1bb79d2c443e61e331f2578b69 | |
| parent | a808a2b35f66658e6c49dc98b55a33fa1079fe72 (diff) | |
scripts/faddr2line: Set LANG=C to enforce ASCII output
Force tools like readelf to use the POSIX/C locale by exporting LANG=C
This ensures ASCII-only output and avoids locale-specific
characters(e.g., UTF-8 symbols or translated strings), which could
break text processing utilities like sed in the script
Signed-off-by: John Wang <wangzq.jn@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
| -rwxr-xr-x | scripts/faddr2line | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/faddr2line b/scripts/faddr2line index 1fa6beef9f97..1f364fbb0cd8 100755 --- a/scripts/faddr2line +++ b/scripts/faddr2line @@ -76,6 +76,10 @@ ADDR2LINE="${UTIL_PREFIX}addr2line${UTIL_SUFFIX}" AWK="awk" GREP="grep" +# Enforce ASCII-only output from tools like readelf +# ensuring sed processes strings correctly. +export LANG=C + command -v ${AWK} >/dev/null 2>&1 || die "${AWK} isn't installed" command -v ${READELF} >/dev/null 2>&1 || die "${READELF} isn't installed" command -v ${ADDR2LINE} >/dev/null 2>&1 || die "${ADDR2LINE} isn't installed" |