2 # Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
13 my $expectedsyms=$ARGV[0];
18 my $objfilelist = join(" ", @ARGV);
24 if ($Config{osname} eq "MSWin32") {
26 $cmd = "dumpbin /imports " . $objfilelist;
28 open $expsyms, '<', $expectedsyms or die;
34 open($OBJFH, "$cmd|") or die "Cannot open process: $!";
39 $dllfile =~ s/( +)(.*)(\.dll)(.*)/DLLFILE \2/;
40 if (index($dllfile, "DLLFILE") >= 0) {
41 $currentdll = substr($dllfile, 8);
42 $currentdll =~ s/^\s+|s+$//g;
44 # filter imports from our own library
45 if ("$currentdll" ne "libcrypto-3-x64") {
47 $line =~ s/ [0-9a-fA-F]{1,2} /SYMBOL /;
48 if (index($line, "SYMBOL") != -1) {
49 $line =~ s/.*SYMBOL //;
50 push(@symlist, $line);
55 if (index($exps, $_) < 0) {
56 print "Symbol $_ not in the allowed platform symbols list\n";
63 $cmd = "objdump -t " . $objfilelist . " | grep UND | grep -v \@OPENSSL";
64 $cmd = $cmd . " | awk '{print \$NF}' |";
65 $cmd = $cmd . " sed -e\"s/@.*\$//\" | sort | uniq";
67 open $expsyms, '<', $expectedsyms or die;
74 open($OBJFH, "$cmd|") or die "Cannot open process: $!";
77 if (index($exps, $_) < 0) {
78 print "Symbol $_ not in the allowed platform symbols list\n";