File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,27 @@ set -o noclobber -o nounset -o pipefail -o errexit
2626mod_path=$1
2727shift
2828
29- readarray -t fenceposts < <( readelf --wide --sections --symbols " $mod_path " | awk '
29+ # require Gnu Awk, for strtonum().
30+
31+ if [[ -v AWK ]] && ! " $AWK " --version 2>&1 | grep -F -q ' GNU Awk' ; then
32+ unset AWK
33+ fi
34+
35+ if [[ ! -v AWK ]]; then
36+ if command -v gawk > /dev/null; then
37+ AWK=' gawk'
38+ else
39+ AWK=' awk'
40+ fi
41+ fi
42+
43+ if ! " $AWK " --version 2>&1 | grep -F -q ' GNU Awk' ; then
44+ echo " Couldn't find required GNU Awk executable." >&2
45+ exit 1
46+ fi
47+
48+ # shellcheck disable=SC2016 # using $AWK instead of awk confuses shellcheck.
49+ readarray -t fenceposts < <( readelf --wide --sections --symbols " $mod_path " | " $AWK " '
3050BEGIN {
3151 fips_fenceposts["wc_linuxkm_pie_reloc_tab"] = "reloc_tab_start";
3252 fips_fenceposts["wc_linuxkm_pie_reloc_tab_length"] = "reloc_tab_len_start";
You can’t perform that action at this time.
0 commit comments