Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c02904f

Browse files
bjohannesmeyerjpoimboe
authored andcommitted
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>
1 parent 406b5c1 commit c02904f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/faddr2line

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ __faddr2line() {
252252
found=2
253253
break
254254
fi
255-
done < <(echo "${ELF_SYMS}" | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2)
255+
done < <(echo "${ELF_SYMS}" | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2 | ${GREP} -A1 --no-group-separator " ${sym_name}$")
256256

257257
if [[ $found = 0 ]]; then
258258
warn "can't find symbol: sym_name: $sym_name sym_sec: $sym_sec sym_addr: $sym_addr sym_elf_size: $sym_elf_size"

0 commit comments

Comments
 (0)