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.

Resolves: #2178935
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2023-05-16 10:45:00 +02:00
parent 25b14c8700
commit 4ecf0dd22f
2 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,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

@ -63,8 +63,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