summaryrefslogtreecommitdiff
path: root/scripts/faddr2line
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-16 10:33:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-16 10:33:54 +0200
commite4ed2b5370a2df2b1feeb970904d2f7761c241c9 (patch)
tree852b17dcc8ed1ca8f35771e8f06d660bdfc51804 /scripts/faddr2line
parent4fcae770f3027abefd952c5d511ac6299828865a (diff)
parent33d930e59a98fa10a0db9f56c7fa2f21a4aef9b9 (diff)
downloadlinux-e4ed2b5370a2df2b1feeb970904d2f7761c241c9.tar.gz
linux-e4ed2b5370a2df2b1feeb970904d2f7761c241c9.tar.xz
Merge 4.14-rc5 into usb-next
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/faddr2line')
-rwxr-xr-xscripts/faddr2line5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/faddr2line b/scripts/faddr2line
index 29df825d375c..2f6ce802397d 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -103,11 +103,12 @@ __faddr2line() {
# Go through each of the object's symbols which match the func name.
# In rare cases there might be duplicates.
+ file_end=$(size -Ax $objfile | awk '$1 == ".text" {print $2}')
while read symbol; do
local fields=($symbol)
local sym_base=0x${fields[0]}
local sym_type=${fields[1]}
- local sym_end=0x${fields[3]}
+ local sym_end=${fields[3]}
# calculate the size
local sym_size=$(($sym_end - $sym_base))
@@ -157,7 +158,7 @@ __faddr2line() {
addr2line -fpie $objfile $addr | sed "s; $dir_prefix\(\./\)*; ;"
DONE=1
- done < <(nm -n $objfile | awk -v fn=$func '$3 == fn { found=1; line=$0; start=$1; next } found == 1 { found=0; print line, $1 }')
+ done < <(nm -n $objfile | awk -v fn=$func -v end=$file_end '$3 == fn { found=1; line=$0; start=$1; next } found == 1 { found=0; print line, "0x"$1 } END {if (found == 1) print line, end; }')
}
[[ $# -lt 2 ]] && usage