[PATCH 1/1] scripts/faddr2line: Use C locale for readelf

From: Alexander Stein
Date: Fri Jul 18 2025 - 08:21:12 EST


If readelf support localized output the following sed calls will fail
due to mismatched texts. Use C locale to get untranslated output.

Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
---
scripts/faddr2line | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/faddr2line b/scripts/faddr2line
index 1fa6beef9f978..fbeb67903b792 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -107,7 +107,7 @@ find_dir_prefix() {

run_readelf() {
local objfile=$1
- local out=$(${READELF} --file-header --section-headers --symbols --wide $objfile)
+ local out=$(LANG=C ${READELF} --file-header --section-headers --symbols --wide $objfile)

# This assumes that readelf first prints the file header, then the section headers, then the symbols.
# Note: It seems that GNU readelf does not prefix section headers with the "There are X section headers"
--
2.43.0