|
@@ -17,6 +17,21 @@ elif type c++filt >/dev/null 2>&1 ; then
|
|
|
cppfilt_opts=-i
|
|
|
fi
|
|
|
|
|
|
+UTIL_SUFFIX=
|
|
|
+if [[ -z ${LLVM:-} ]]; then
|
|
|
+ UTIL_PREFIX=${CROSS_COMPILE:-}
|
|
|
+else
|
|
|
+ UTIL_PREFIX=llvm-
|
|
|
+ if [[ ${LLVM} == */ ]]; then
|
|
|
+ UTIL_PREFIX=${LLVM}${UTIL_PREFIX}
|
|
|
+ elif [[ ${LLVM} == -* ]]; then
|
|
|
+ UTIL_SUFFIX=${LLVM}
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
+READELF=${UTIL_PREFIX}readelf${UTIL_SUFFIX}
|
|
|
+ADDR2LINE=${UTIL_PREFIX}addr2line${UTIL_SUFFIX}
|
|
|
+
|
|
|
if [[ $1 == "-r" ]] ; then
|
|
|
vmlinux=""
|
|
|
basepath="auto"
|
|
@@ -52,7 +67,7 @@ fi
|
|
|
find_module() {
|
|
|
if [[ "$modpath" != "" ]] ; then
|
|
|
for fn in $(find "$modpath" -name "${module//_/[-_]}.ko*") ; do
|
|
|
- if readelf -WS "$fn" | grep -qwF .debug_line ; then
|
|
|
+ if ${READELF} -WS "$fn" | grep -qwF .debug_line ; then
|
|
|
echo $fn
|
|
|
return
|
|
|
fi
|
|
@@ -146,7 +161,7 @@ parse_symbol() {
|
|
|
if [[ $aarray_support == true && "${cache[$module,$address]+isset}" == "isset" ]]; then
|
|
|
local code=${cache[$module,$address]}
|
|
|
else
|
|
|
- local code=$(${CROSS_COMPILE}addr2line -i -e "$objfile" "$address" 2>/dev/null)
|
|
|
+ local code=$(${ADDR2LINE} -i -e "$objfile" "$address" 2>/dev/null)
|
|
|
if [[ $aarray_support == true ]]; then
|
|
|
cache[$module,$address]=$code
|
|
|
fi
|