@@ -17,37 +17,34 @@ objdump="$1"
1717vmlinux=" $2 "
1818
1919# __end_interrupts should be located within the first 64K
20+ kstart=0xc000000000000000
21+ printf -v kend ' 0x%x' $(( kstart + 0x10000 ))
2022
2123end_intr=0x$(
22- $objdump -R " $vmlinux " -d --start-address=0xc000000000000000 \
23- --stop-address=0xc000000000010000 |
24- grep ' \<__end_interrupts>:' |
25- awk ' {print $1}'
24+ $objdump -R -d --start-address=" $kstart " --stop-address=" $kend " " $vmlinux " |
25+ awk ' $2 == "<__end_interrupts>:" { print $1 }'
2626)
2727
2828BRANCHES=$(
29- $objdump -R " $vmlinux " -D --start-address=0xc000000000000000 \
30- --stop-address=" $end_intr " |
29+ $objdump -R -D --start-address=" $kstart " --stop-address=" $end_intr " " $vmlinux " |
3130grep -e " ^c[0-9a-f]*:[[:space:]]*\([0-9a-f][0-9a-f][[:space:]]\)\{4\}[[:space:]]*b" |
32- grep -v ' \<__start_initialization_multiplatform>' |
33- grep -v - e ' b.\?.\?ctr' |
34- grep -v - e ' b.\?.\?lr' |
35- sed -e ' s/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' \
31+ sed -e ' / \<__start_initialization_multiplatform>/d ' \
32+ - e ' / b.\?.\?ctr/d ' \
33+ - e ' / b.\?.\?lr/d ' \
34+ -e ' s/\bbt.\?[[:space:]]*[[:digit:]][[:digit:]]*,/beq/' \
3635 -e ' s/\bbf.\?[[:space:]]*[[:digit:]][[:digit:]]*,/bne/' \
3736 -e ' s/[[:space:]]0x/ /' \
3837 -e ' s/://' |
3938awk ' { print $1 ":" $6 ":0x" $7 ":" $8 " "}'
4039)
4140
42- for tuple in $BRANCHES
43- do
41+ for tuple in $BRANCHES ; do
4442 from=$( echo " $tuple " | cut -d' :' -f1)
4543 branch=$( echo " $tuple " | cut -d' :' -f2)
4644 to=$( echo " $tuple " | cut -d' :' -f3 | sed ' s/cr[0-7],//' )
4745 sym=$( echo " $tuple " | cut -d' :' -f4)
4846
49- if (( to > end_intr ))
50- then
47+ if (( to > end_intr )) ; then
5148 if [ -z " $bad_branches " ]; then
5249 echo " WARNING: Unrelocated relative branches"
5350 bad_branches=" yes"
0 commit comments