summaryrefslogtreecommitdiff
path: root/scripts/faddr2line
diff options
context:
space:
mode:
authorBrian Johannesmeyer <bjohannesmeyer@gmail.com>2024-04-15 16:55:38 +0200
committerJosh Poimboeuf <jpoimboe@kernel.org>2024-07-02 23:38:37 -0700
commitc02904f05ff805d6c0631634d5751ebd338f75ec (patch)
tree7fd6feabcc71cbb672a961ae815ad57b612898f2 /scripts/faddr2line
parent406b5c12aad8110e1b1f9355f176cac43cd1fecb (diff)
downloadlwn-c02904f05ff805d6c0631634d5751ebd338f75ec.tar.gz
lwn-c02904f05ff805d6c0631634d5751ebd338f75ec.zip
scripts/faddr2line: Check only two symbols when calculating symbol size
Rather than looping through each symbol in a particular section to calculate a symbol's size, grep for the symbol and its immediate successor, and only use those two symbols. Signed-off-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Link: https://lore.kernel.org/r/20240415145538.1938745-8-bjohannesmeyer@gmail.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'scripts/faddr2line')
-rwxr-xr-xscripts/faddr2line2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/faddr2line b/scripts/faddr2line
index 1fa6beef9f97..fe0cc45f03be 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -252,7 +252,7 @@ __faddr2line() {
found=2
break
fi
- done < <(echo "${ELF_SYMS}" | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2)
+ done < <(echo "${ELF_SYMS}" | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2 | ${GREP} -A1 --no-group-separator " ${sym_name}$")
if [[ $found = 0 ]]; then
warn "can't find symbol: sym_name: $sym_name sym_sec: $sym_sec sym_addr: $sym_addr sym_elf_size: $sym_elf_size"