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 <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22880)
This commit is contained in:
Richard Levitte 2023-11-30 09:02:25 +01:00
parent 6c63b7e861
commit 4ff5137ff5

View File

@ -114,9 +114,19 @@ foreach (sort keys %stlibname) {
my @arrays = ( \@stlib_lines ); my @arrays = ( \@stlib_lines );
push @arrays, \@shlib_lines unless disabled('shared'); push @arrays, \@shlib_lines unless disabled('shared');
foreach (@arrays) { foreach (@arrays) {
my %commons;
foreach (@$_) {
if (m|^(.*) C .*|) {
$commons{$1}++;
}
}
foreach (sort keys %commons) {
note "Common symbol: $_";
}
@$_ = @$_ =
sort sort
map { ( map {
# Drop the first space and everything following it # Drop the first space and everything following it
s| .*||; s| .*||;
# Drop OpenSSL dynamic version information if there is any # Drop OpenSSL dynamic version information if there is any
@ -129,8 +139,9 @@ foreach (sort keys %stlibname) {
# of our business # of our business
grep !m|^__|, grep !m|^__|,
# Only look at external definitions # Only look at external definitions
grep m|.* [BCDST] .*|, grep m|.* [BDST] .*|,
@$_ ), @$_ ),
keys %commons;
} }
# Massage the mkdef.pl output to only contain global symbols # Massage the mkdef.pl output to only contain global symbols