VirtualBox

source: vbox/trunk/src/libs/openssl-3.3.2/util/checkplatformsyms.pl@ 108403

最後變更 在這個檔案從108403是 108206,由 vboxsync 提交於 5 週 前

openssl-3.3.2: Exported all files to OSE and removed .scm-settings ​bugref:10757

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.4 KB
 
1#! /usr/bin/env perl
2# Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved.
3#
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
8
9use warnings;
10use strict;
11use Config;
12
13my $expectedsyms=$ARGV[0];
14
15shift(@ARGV);
16
17my $objlist;
18my $objfilelist = join(" ", @ARGV);
19my $expsyms;
20my $exps;
21my $OBJFH;
22my $cmd;
23
24if ($Config{osname} eq "MSWin32") {
25 my $currentdll = "";
26 $cmd = "dumpbin /imports " . $objfilelist;
27 my @symlist;
28 open $expsyms, '<', $expectedsyms or die;
29 {
30 local $/;
31 $exps=<$expsyms>;
32 }
33 close($expsyms);
34 open($OBJFH, "$cmd|") or die "Cannot open process: $!";
35 while (<$OBJFH>)
36 {
37 chomp;
38 my $dllfile = $_;
39 $dllfile =~ s/( +)(.*)(\.dll)(.*)/DLLFILE \2/;
40 if (index($dllfile, "DLLFILE") >= 0) {
41 $currentdll = substr($dllfile, 8);
42 $currentdll =~ s/^\s+|s+$//g;
43 }
44 # filter imports from our own library
45 if ("$currentdll" ne "libcrypto-3-x64") {
46 my $line = $_;
47 $line =~ s/ [0-9a-fA-F]{1,2} /SYMBOL /;
48 if (index($line, "SYMBOL") != -1) {
49 $line =~ s/.*SYMBOL //;
50 push(@symlist, $line);
51 }
52 }
53 }
54 foreach (@symlist) {
55 if (index($exps, $_) < 0) {
56 print "Symbol $_ not in the allowed platform symbols list\n";
57 exit 1;
58 }
59 }
60 exit 0;
61 }
62else {
63 $cmd = "objdump -t " . $objfilelist . " | grep UND | grep -v \@OPENSSL";
64 $cmd = $cmd . " | awk '{print \$NF}' |";
65 $cmd = $cmd . " sed -e\"s/@.*\$//\" | sort | uniq";
66
67 open $expsyms, '<', $expectedsyms or die;
68 {
69 local $/;
70 $exps=<$expsyms>;
71 }
72 close($expsyms);
73
74 open($OBJFH, "$cmd|") or die "Cannot open process: $!";
75 while (<$OBJFH>)
76 {
77 if (index($exps, $_) < 0) {
78 print "Symbol $_ not in the allowed platform symbols list\n";
79 exit 1;
80 }
81 }
82 close($OBJFH);
83 exit 0;
84 }
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette