Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: unrel_branch_check.sh: use nm to find symbol value

This is considerably faster then parsing the objdump asm output. It will
also make the enabling of llvm-objdump a little easier.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200812081036.7969-2-sfr@canb.auug.org.au

authored by

Stephen Rothwell and committed by
Michael Ellerman
b71dca98 af13a224

+6 -9
+5 -8
arch/powerpc/tools/unrel_branch_check.sh
··· 5 5 # This script checks the unrelocated code of a vmlinux for "suspicious" 6 6 # branches to relocated code (head_64.S code). 7 7 8 - # Have Kbuild supply the path to objdump so we handle cross compilation. 8 + # Have Kbuild supply the path to objdump and nm so we handle cross compilation. 9 9 objdump="$1" 10 - vmlinux="$2" 10 + nm="$2" 11 + vmlinux="$3" 11 12 12 - #__end_interrupts should be located within the first 64K 13 13 kstart=0xc000000000000000 14 - printf -v kend '0x%x' $(( kstart + 0x10000 )) 15 14 16 - end_intr=0x$( 17 - $objdump -R -d --start-address="$kstart" --stop-address="$kend" "$vmlinux" 2>/dev/null | 18 - awk '$2 == "<__end_interrupts>:" { print $1 }' 19 - ) 15 + end_intr=0x$($nm -p "$vmlinux" | 16 + sed -E -n '/\s+[[:alpha:]]\s+__end_interrupts\s*$/{s///p;q}') 20 17 if [ "$end_intr" = "0x" ]; then 21 18 exit 0 22 19 fi