]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/retpoline-extract
UBUNTU: [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / retpoline-extract
1 #!/bin/bash
2
3 cd "$1" || exit 1
4
5 {
6 echo "./vmlinux"
7 find . -name \*.ko
8 } | xargs objdump --disassemble | \
9 awk -F' ' '
10 /^.\// { file=$1; sub(":.*", "", file); sub("^.*/", "", file); }
11 /^[0-9a-f][0-9a-f]* <.*>:/ { tag=$1; sub(".*<", "", tag); sub(">.*", "", tag); tag=file " " tag; }
12 $3 ~ /(call|jmp)q? *\*(0x[a-f0-9]+\()?%/ { print(tag " " $3); }
13 ' | \
14 grep -v " \*%cs:0x" # elide 32bit code-segment absolute offsets.