find-provides.ksyms, find-requires.ksyms: match only the section being processed

Instead of ignoring the section name in the objdump -t output, section
name has to be checked in the awk script to produce only the meaningful
output;  hit when both __kcrctab and __kcrctab_gpl are present.

* find-requires.ksyms (all_provides): Pass $sectname to the awk script,
check that the relevant field of the input matches it.
* find-provides.ksyms: Likewise.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2023-05-16 10:45:00 +02:00
parent 027d626014
commit 0a8324122a
2 changed files with 4 additions and 2 deletions

View File

@ -62,8 +62,9 @@ for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do
| awk \
-v 'dep_pfx='"$dep_pfx" \
-v 'sectdata='"$SECTDATA" \
-v 'sectname='"$sectname" \
--non-decimal-data \
'match($0, /^([0-9a-f]+) [gl]...... .* [0-9a-f]+ __crc_(.*)$/, a) { printf("%s(%s) = 0x%08s\n", dep_pfx, a[2], substr(sectdata, (strtonum("0x" a[1]) * 2) + 1, 8)) }'
'match($0, /^([0-9a-f]+) [gl]...... (.*) [0-9a-f]+ __crc_(.*)$/, a) && a[2] == sectname { printf("%s(%s) = 0x%08s\n", dep_pfx, a[3], substr(sectdata, (strtonum("0x" a[1]) * 2) + 1, 8)) }'
done \
| sort -u
fi

View File

@ -62,8 +62,9 @@ all_provides() {
| awk \
-v 'dep_pfx='"$dep_pfx" \
-v 'sectdata='"$SECTDATA" \
-v 'sectname='"$sectname" \
--non-decimal-data \
'match($0, /^([0-9a-f]+) [gl]...... .* [0-9a-f]+ __crc_(.*)$/, a) { printf("%s(%s) = 0x%08s\n", dep_pfx, a[2], substr(sectdata, (strtonum("0x" a[1]) * 2) + 1, 8)) }'
'match($0, /^([0-9a-f]+) [gl]...... (.*) [0-9a-f]+ __crc_(.*)$/, a) && a[2] == sectname { printf("%s(%s) = 0x%08s\n", dep_pfx, a[3], substr(sectdata, (strtonum("0x" a[1]) * 2) + 1, 8)) }'
done
fi