summaryrefslogtreecommitdiff
path: root/test/recipes/01-test_symbol_presence.t
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2023-11-30 09:02:25 +0100
committerRichard Levitte <levitte@openssl.org>2023-12-04 09:55:15 +0100
commit4ff5137ff5fb896e0273d274110517e3c7adb8cf (patch)
tree88b34dd3d6d77a49b3f44857606f3e53e84cb2dd /test/recipes/01-test_symbol_presence.t
parent6c63b7e861819db439551b52ea5594faec04b65c (diff)
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)
Diffstat (limited to 'test/recipes/01-test_symbol_presence.t')
-rw-r--r--test/recipes/01-test_symbol_presence.t41
1 files changed, 26 insertions, 15 deletions
diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t
index 66e5669e19..222b1886ae 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