summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-09-19 14:49:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-09-19 14:49:08 -0700
commit7fadce0d60d09427e0027d3d468781b08ca0b3d1 (patch)
tree54192b2c448828a575ba0a04eac91fffb376660e /scripts
parent7bb91e06730140a693611e51a4a9636152448bd3 (diff)
downloadlinux-rpi3-7fadce0d60d09427e0027d3d468781b08ca0b3d1.tar.gz
linux-rpi3-7fadce0d60d09427e0027d3d468781b08ca0b3d1.tar.bz2
linux-rpi3-7fadce0d60d09427e0027d3d468781b08ca0b3d1.zip
scripts/faddr2line: improve on base path filtering a bit
Due to our compiler include directives, the build pathnames for header files often end up being of the form "$srcdir/./include/linux/xyz.h", which ends up having that extra "." path component after the build base in it. Teach faddr2line to skip that too, to make code generated in inline functions in header files match the filename for the regular C files. Rabin Vincent pointed out that I can't make a stricter regexp match by using the " at " prefix for the pathname, because that ends up being locale-dependent. But this does require that the path match be preceded by a space, to make it a bit more strict (that matters mainly if we didn't find any base_dir at all, and we only end up with the "./" part of the match) Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Rabin Vincent <rabin@rab.in> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/faddr2line2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/faddr2line b/scripts/faddr2line
index 4fbfe8305fe3..450b33257339 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -145,7 +145,7 @@ __faddr2line() {
local hexsize=0x$(printf %x $sym_size)
echo "$func+$offset/$hexsize:"
- addr2line -fpie $objfile $hexaddr | sed "s;$dir_prefix;;"
+ addr2line -fpie $objfile $hexaddr | sed "s; $dir_prefix\(\./\)*; ;"
DONE=1
done < <(readelf -sW $objfile | awk -v f=$func '$8 == f {print}')