]>
git.proxmox.com Git - mirror_ubuntu-kernels.git/blob - arch/powerpc/tools/relocs_check.sh
2 # SPDX-License-Identifier: GPL-2.0-or-later
4 # Copyright © 2015 IBM Corporation
7 # This script checks the relocations of a vmlinux for "suspicious"
10 # based on relocs_check.pl
11 # Copyright © 2009 IBM Corporation
14 echo "$0 [path to objdump] [path to vmlinux]" 1>&2
18 # Have Kbuild supply the path to objdump so we handle cross compilation.
23 "$objdump" -R "$vmlinux" |
24 # Only look at relocation lines.
26 # These relocations are okay
28 # R_PPC64_RELATIVE, R_PPC64_NONE
29 # R_PPC64_ADDR64 mach_<name>
30 # R_PPC64_ADDR64 __crc_<name>
32 # R_PPC_RELATIVE, R_PPC_ADDR16_HI,
33 # R_PPC_ADDR16_HA,R_PPC_ADDR16_LO,
35 grep -F -w -v 'R_PPC64_RELATIVE
42 grep -E -v '\<R_PPC64_ADDR64[[:space:]]+mach_' |
43 grep -E -v '\<R_PPC64_ADDR64[[:space:]]+__crc_'
46 if [ -z "$bad_relocs" ]; then
50 num_bad
=$
(echo "$bad_relocs" |
wc -l)
51 echo "WARNING: $num_bad bad relocations"
54 # If we see this type of relocation it's an idication that
55 # we /may/ be using an old version of binutils.
56 if echo "$bad_relocs" |
grep -q -F -w R_PPC64_UADDR64
; then
57 echo "WARNING: You need at least binutils >= 2.19 to build a CONFIG_RELOCATABLE kernel"