align read-only sections on masm/windows to 64 bytes
authorbcook <bcook@openbsd.org>
Tue, 27 Feb 2024 13:12:33 +0000 (13:12 +0000)
committerbcook <bcook@openbsd.org>
Tue, 27 Feb 2024 13:12:33 +0000 (13:12 +0000)
Avoid conflicts where alignment is specified later in the underlying
assembly.

ok tb@

lib/libcrypto/perlasm/x86_64-xlate.pl

index 325e7cf..1e54753 100755 (executable)
@@ -567,7 +567,15 @@ my %globals;
                                        $v.="$line\tSEGMENT";
                                        if ($line=~/\.([prx])data/) {
                                            $v.=" READONLY";
-                                           $v.=" ALIGN(".($1 eq "p" ? 4 : 8).")" if ($masm>=$masmref);
+                                           if ($masm>=$masmref) {
+                                                   if ($1 eq "r") {
+                                                           $v.=" ALIGN(64)";
+                                                   } elsif ($1 eq "p") {
+                                                           $v.=" ALIGN(4)";
+                                                   } else {
+                                                           $v.=" ALIGN(8)";
+                                                   }
+                                           }
                                        } elsif ($line=~/\.CRT\$/i) {
                                            $v.=" READONLY ";
                                            $v.=$masm>=$masmref ? "ALIGN(8)" : "DWORD";