]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
util/checkplatformsyms.pl: update the Unix symbol filtering
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 31 Mar 2026 10:17:51 +0000 (12:17 +0200)
committerTomas Mraz <tomas@openssl.foundation>
Fri, 3 Apr 2026 15:41:40 +0000 (17:41 +0200)
Replace the grep|grep|awk|sed|sort|uniq abomination with a simple
and elegant awk script.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Apr  3 15:42:20 2026
(Merged from https://github.com/openssl/openssl/pull/30635)

util/checkplatformsyms.pl

index f0ab62bdbac71f2b604642f100cfdf2f906e0ffa..0f44a4dbd90a94cfa5ae0270c56becd73faf217a 100755 (executable)
@@ -73,9 +73,13 @@ if ($Config{osname} eq "MSWin32") {
         exit !$ok;
     }
 else {
-        $cmd = "objdump -t " . $objfilelist . " | grep UND | grep -v \@OPENSSL";
-        $cmd = $cmd . " | awk '{print \$NF}' |";
-        $cmd = $cmd . " sed -e\"s/@.*\$//\" | sort | uniq";
+        $cmd = "objdump -t " . $objfilelist . " | awk " .
+            "'/\\\\*UND\\\\*/ {" .
+                "split(\$NF, sym_lib, \"@\");" .
+                "if (sym_lib[2] !~ \"OPENSSL_[1-9][0-9]*\\\\.[0-9]+\\\\.[0-9]+\$\")" .
+                    "syms[sym_lib[1]] = 1;" .
+            "}" .
+            "END { for (s in syms) print s; };'";
 
         open $expsyms, '<', $expectedsyms or die;
         {