The limit per SYMBOL_VECTOR isn't the amount of symbols, it's the line length
authorRichard Levitte <levitte@openssl.org>
Tue, 12 Jan 2016 00:07:46 +0000 (01:07 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 12 Jan 2016 03:44:24 +0000 (04:44 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
util/mkdef.pl

index 6d5b00d..da2dbd3 100755 (executable)
@@ -1198,7 +1198,7 @@ sub print_def_file
        my $prevsymversion = "", $prevprevsymversion = "";
         # For VMS
         my $prevnum = 0;
-        my $symbolcount = 0;
+        my $symvtextcount = 0;
 
        if ($W32)
                { $libname.="32"; }
@@ -1240,6 +1240,7 @@ LIB$libname.OLB /LIBRARY
 $libref
 SYMBOL_VECTOR=(-
 EOF
+                $symvtextcount = 16; # length of "SYMBOL_VECTOR=(-"
                 }
 
        (@r)=grep(/^\w+(\{[0-9]+\})?\\.*?:.*?:FUNCTION/,@symbols);
@@ -1303,25 +1304,29 @@ EOF
                                                print OUT "        $s2;\n";
                                         } elsif ($VMS) {
                                             while(++$prevnum < $n) {
-                                                if ($symbolcount > 1023) {
+                                                my $symline="dummy$prevcount=PRIVATE_PROCEDURE -";
+                                                if ($symvtextcount + length($symline) + 1 > 1024) {
                                                     print OUT ")\nSYMBOL_VECTOR=(-\n";
-                                                    $symbolcount = 0;
+                                                    $symvtextcount = 16; # length of "SYMBOL_VECTOR=(-"
                                                 }
-                                                print OUT $symbolcount
-                                                    ? "    ," : "    ";
-                                                print OUT "dummy$prevnum=PRIVATE_PROCEDURE -\n";
-                                                $symbolcount++;
+                                                if ($symvtextcount > 16) {
+                                                    $symline = ",".$symline;
+                                                }
+                                                print OUT "    $symline\n";
+                                                $symvtextcount += length($symline);
                                             }
                                             (my $s_uc = $s) =~ tr/a-z/A-Z/;
-                                            if ($symbolcount > 1023) {
+                                            my $symline="$s_uc/$s="
+                                                , ($v ? "DATA" : "PROCEDURE"), " -\n";
+                                            if ($symvtextcount + length($symline) + 1 > 1024) {
                                                 print OUT ")\nSYMBOL_VECTOR=(-\n";
-                                                $symbolcount = 0;
+                                                $symvtextcount = 16; # length of "SYMBOL_VECTOR=(-"
                                             }
-                                            print OUT $symbolcount
-                                                ? "    ," : "    ";
-                                            print OUT "$s_uc/$s="
-                                                , ($v ? "DATA" : "PROCEDURE"), " -\n";
-                                            $symbolcount++;
+                                            if ($symvtextcount > 16) {
+                                                $symline = ",".$symline;
+                                            }
+                                            print OUT "    $symline\n";
+                                            $symvtextcount += length($symline);
                                        } elsif($v && !$OS2) {
                                                printf OUT "    %s%-39s @%-8d DATA\n",
                                                                ($W32)?"":"_",$s2,$n;