| 1 |
#!/bin/sh |
| 2 |
# SPDX-License-Identifier: GPL-2.0-or-later |
| 3 |
# Based on powerpc relocs_check.sh |
| 4 |
|
| 5 |
# This script checks the relocations of a vmlinux for "suspicious" |
| 6 |
# relocations. |
| 7 |
|
| 8 |
if [ $# -lt 3 ]; then |
| 9 |
echo "$0 [path to objdump] [path to nm] [path to vmlinux]" 1>&2 |
| 10 |
exit 1 |
| 11 |
fi |
| 12 |
|
| 13 |
bad_relocs=$( |
| 14 |
${srctree}/scripts/relocs_check.sh "$@" | |
| 15 |
# These relocations are okay |
| 16 |
# R_RISCV_RELATIVE |
| 17 |
# R_RISCV_NONE |
| 18 |
grep -F -w -v 'R_RISCV_RELATIVE |
| 19 |
R_RISCV_NONE' |
| 20 |
) |
| 21 |
|
| 22 |
if [ -z "$bad_relocs" ]; then |
| 23 |
exit 0 |
| 24 |
fi |
| 25 |
|
| 26 |
num_bad=$(echo "$bad_relocs" | wc -l) |
| 27 |
echo "WARNING: $num_bad bad relocations" |
| 28 |
echo "$bad_relocs" |