]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix test/recipes/01-test_symbol_presence.t to disregard version info
authorRichard Levitte <levitte@openssl.org>
Thu, 14 Oct 2021 16:49:11 +0000 (18:49 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 14 Oct 2021 17:04:10 +0000 (19:04 +0200)
The output of 'nm -DPg' contains version info attached to the symbols,
which makes the test fail.  Simply dropping the version info makes the
test work again.

Fixes #16810 (followup)

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

(cherry picked from commit 73970cb91fdf8e7b4b434d479b875a47a0aa0dbc)

test/recipes/01-test_symbol_presence.t

index 39ed4d447b9b6ce4c61f48cf0c117891a6f12718..e75d2c3e7281f13bae672b4db898be222214ad92 100644 (file)
@@ -57,7 +57,17 @@ foreach my $libname (@libnames) {
         note "Number of lines in \@def_lines before massaging: ", scalar @def_lines;
 
         # Massage the nm output to only contain defined symbols
-        @nm_lines = sort map { s| .*||; $_ } grep(m|.* [BCDST] .*|, @nm_lines);
+        @nm_lines =
+            sort
+            map {
+                # Drop the first space and everything following it
+                s| .*||;
+                # Drop OpenSSL dynamic version information if there is any
+                s|\@\@OPENSSL_[0-9._]+[a-z]?$||;
+                # Return the result
+                $_
+            }
+            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