mbox series

[0/2] add missing local symbols catch-all

Message ID 20220306092023.2461466-1-thomas@monjalon.net (mailing list archive)
Headers
Series add missing local symbols catch-all |

Message

Thomas Monjalon March 6, 2022, 9:20 a.m. UTC
  The libraries (and driver) regexdev, gpudev and auxiliary bus
were missing "local:*" in their version.map linker script
which catch all non-listed functions to be hidden in shared libraries.

Thomas Monjalon (2):
  regexdev: fix section attribute of symbols
  build: hide local symbols in shared libraries

 devtools/libabigail.abignore       | 12 ++++++++++++
 drivers/bus/auxiliary/version.map  |  2 ++
 lib/gpudev/version.map             |  2 ++
 lib/regexdev/rte_regexdev.h        |  4 ++++
 lib/regexdev/rte_regexdev_driver.h |  3 +++
 lib/regexdev/version.map           | 11 +++++++++++
 6 files changed, 34 insertions(+)
  

Comments

David Marchand March 7, 2022, 1:14 p.m. UTC | #1
On Sun, Mar 6, 2022 at 10:20 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The libraries (and driver) regexdev, gpudev and auxiliary bus
> were missing "local:*" in their version.map linker script
> which catch all non-listed functions to be hidden in shared libraries.
>
> Thomas Monjalon (2):
>   regexdev: fix section attribute of symbols
>   build: hide local symbols in shared libraries
>
>  devtools/libabigail.abignore       | 12 ++++++++++++
>  drivers/bus/auxiliary/version.map  |  2 ++
>  lib/gpudev/version.map             |  2 ++
>  lib/regexdev/rte_regexdev.h        |  4 ++++
>  lib/regexdev/rte_regexdev_driver.h |  3 +++
>  lib/regexdev/version.map           | 11 +++++++++++
>  6 files changed, 34 insertions(+)

The series lgtm.


What do you think of adding a check like:

diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
index 5bd290ac97..4b7e340833 100755
--- a/devtools/check-symbol-maps.sh
+++ b/devtools/check-symbol-maps.sh
@@ -53,4 +53,18 @@ if [ -n "$duplicate_symbols" ] ; then
     ret=1
 fi

+check_local_guard ()
+{
+    for map in $@ ; do
+        grep -L local: $map || true
+    done
+}
+
+local_missing_map=$(check_local_guard $@)
+if [ -n "$local_missing_map" ] ; then
+    echo "Following maps are missing a local: guard:"
+    echo "$local_missing_map"
+    ret=1
+fi
+
 exit $ret



$ ./devtools/check-symbol-maps.sh
Following maps are missing a local: guard:
lib/regexdev/version.map
lib/gpudev/version.map
drivers/bus/auxiliary/version.map