From: Richard Levitte Date: Thu, 30 Nov 2023 08:02:25 +0000 (+0100) Subject: test/recipes/01-test_symbol_presence.t: Treat common symbols specially X-Git-Tag: openssl-3.3.0-alpha1~533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ff5137ff5fb896e0273d274110517e3c7adb8cf;p=thirdparty%2Fopenssl.git test/recipes/01-test_symbol_presence.t: Treat common symbols specially Common symbols (type 'C' in the 'nm' output) are allowed to be defined more than once. This makes test/recipes/01-test_symbol_presence.t reflect that. Fixes #22869 (partially) Fixes #22837 Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22880) --- diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t index 66e5669e193..222b1886aec 100644 --- a/test/recipes/01-test_symbol_presence.t +++ b/test/recipes/01-test_symbol_presence.t @@ -114,23 +114,34 @@ foreach (sort keys %stlibname) { my @arrays = ( \@stlib_lines ); push @arrays, \@shlib_lines unless disabled('shared'); foreach (@arrays) { + my %commons; + foreach (@$_) { + if (m|^(.*) C .*|) { + $commons{$1}++; + } + } + foreach (sort keys %commons) { + note "Common symbol: $_"; + } + @$_ = sort - map { - # Drop the first space and everything following it - s| .*||; - # Drop OpenSSL dynamic version information if there is any - s|\@\@.+$||; - # Return the result - $_ - } - # 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] .*|, - @$_ ), + ( map { + # Drop the first space and everything following it + s| .*||; + # Drop OpenSSL dynamic version information if there is any + s|\@\@.+$||; + # Return the result + $_ + } + # 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|.* [BDST] .*|, + @$_ ), + keys %commons; } # Massage the mkdef.pl output to only contain global symbols