devtools: catch empty symbol maps
Checks
Commit Message
version.map are now optional for drivers if no symbol is exported.
Having no symbol exported from a library does not make sense.
Catch all empty maps and warn about them.
Example:
$ ./devtools/check-symbol-maps.sh
Found empty maps:
drivers/crypto/uadk/version.map
drivers/net/gve/version.map
drivers/net/idpf/version.map
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
devtools/check-symbol-maps.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Comments
On Mon, Nov 14, 2022 at 03:16:51PM +0100, David Marchand wrote:
> version.map are now optional for drivers if no symbol is exported.
> Having no symbol exported from a library does not make sense.
>
> Catch all empty maps and warn about them.
>
> Example:
> $ ./devtools/check-symbol-maps.sh
> Found empty maps:
> drivers/crypto/uadk/version.map
> drivers/net/gve/version.map
> drivers/net/idpf/version.map
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
On 11/14/2022 2:31 PM, Bruce Richardson wrote:
> On Mon, Nov 14, 2022 at 03:16:51PM +0100, David Marchand wrote:
>> version.map are now optional for drivers if no symbol is exported.
>> Having no symbol exported from a library does not make sense.
>>
>> Catch all empty maps and warn about them.
>>
>> Example:
>> $ ./devtools/check-symbol-maps.sh
>> Found empty maps:
>> drivers/crypto/uadk/version.map
>> drivers/net/gve/version.map
>> drivers/net/idpf/version.map
>>
>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>> ---
>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
+1 to have automated checks,
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
14/11/2022 16:10, Ferruh Yigit:
> On 11/14/2022 2:31 PM, Bruce Richardson wrote:
> > On Mon, Nov 14, 2022 at 03:16:51PM +0100, David Marchand wrote:
> >> version.map are now optional for drivers if no symbol is exported.
> >> Having no symbol exported from a library does not make sense.
> >>
> >> Catch all empty maps and warn about them.
> >>
> >> Example:
> >> $ ./devtools/check-symbol-maps.sh
> >> Found empty maps:
> >> drivers/crypto/uadk/version.map
> >> drivers/net/gve/version.map
> >> drivers/net/idpf/version.map
> >>
> >> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
> +1 to have automated checks,
> Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
Applied, thanks.
@@ -60,4 +60,18 @@ if [ -n "$local_miss_maps" ] ; then
ret=1
fi
+find_empty_maps ()
+{
+ for map in $@ ; do
+ [ $(buildtools/map-list-symbol.sh $map | wc -l) != '0' ] || echo $map
+ done
+}
+
+empty_maps=$(find_empty_maps $@)
+if [ -n "$empty_maps" ] ; then
+ echo "Found empty maps:"
+ echo "$empty_maps"
+ ret=1
+fi
+
exit $ret