aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/tools/unrel_branch_check.sh
diff options
context:
space:
mode:
authorStephen Rothwell2020-08-12 18:10:35 +1000
committerMichael Ellerman2020-09-02 11:00:22 +1000
commitb71dca9891b330d5c2d3ff5d41704aa6f64f8e32 (patch)
tree5aca71a8a5a9f524396efef0186cd5e79271cc59 /arch/powerpc/tools/unrel_branch_check.sh
parentaf13a2244d59c4d63a25abd8257cbaef9d9ffebc (diff)
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
Diffstat (limited to 'arch/powerpc/tools/unrel_branch_check.sh')
-rwxr-xr-xarch/powerpc/tools/unrel_branch_check.sh13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/powerpc/tools/unrel_branch_check.sh b/arch/powerpc/tools/unrel_branch_check.sh
index 70da90270c78..0369eb2e7e4b 100755
--- a/arch/powerpc/tools/unrel_branch_check.sh
+++ b/arch/powerpc/tools/unrel_branch_check.sh
@@ -5,18 +5,15 @@
# This script checks the unrelocated code of a vmlinux for "suspicious"
# branches to relocated code (head_64.S code).
-# Have Kbuild supply the path to objdump so we handle cross compilation.
+# Have Kbuild supply the path to objdump and nm so we handle cross compilation.
objdump="$1"
-vmlinux="$2"
+nm="$2"
+vmlinux="$3"
-#__end_interrupts should be located within the first 64K
kstart=0xc000000000000000
-printf -v kend '0x%x' $(( kstart + 0x10000 ))
-end_intr=0x$(
-$objdump -R -d --start-address="$kstart" --stop-address="$kend" "$vmlinux" 2>/dev/null |
-awk '$2 == "<__end_interrupts>:" { print $1 }'
-)
+end_intr=0x$($nm -p "$vmlinux" |
+ sed -E -n '/\s+[[:alpha:]]\s+__end_interrupts\s*$/{s///p;q}')
if [ "$end_intr" = "0x" ]; then
exit 0
fi