]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/recipes/01-test_symbol_presence.t: Ignore symbols starting with '__'
authorRichard Levitte <levitte@openssl.org>
Thu, 30 Nov 2023 07:48:33 +0000 (08:48 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 8 Dec 2023 08:07:35 +0000 (09:07 +0100)
On some platforms, the compiler may add symbols that aren't ours and that we
should ignore.

They are generally expected to start with a double underscore, and thereby
easy to detect.

(backport of commit 6c63b7e861819db439551b52ea5594faec04b65c)

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22929)

test/recipes/01-test_symbol_presence.t

index 5530ade0addddbfe895554294de20ff713caffd3..8aaea51a889c05d9ba3a66c65bf28640ff650766 100644 (file)
@@ -80,7 +80,13 @@ foreach my $libname (@libnames) {
                 # Return the result
                 $_
             }
-            grep(m|.* [BCDST] .*|, @nm_lines);
+            # Drop any symbol starting with a double underscore, they
+            # are reserved for the compiler / system ABI and are none
+            # of our business
+            grep !m|^__|,
+            # Only look at external definitions
+            grep m|.* [BCDST] .*|,
+            @nm_lines;
 
         # Massage the mkdef.pl output to only contain global symbols
         # The output we got is in Unix .map format, which has a global