Skip to content

Commit

Permalink
update windows alignment patch to be more targeted
Browse files Browse the repository at this point in the history
  • Loading branch information
busterb committed Feb 5, 2024
1 parent 99dc949 commit e9d9c93
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions patches/asm/masm-align-64.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
commit f51fe0c900b1a3adf281da6ea7ea45421f6ab424
commit b493cd50343b0cfed8010654769f156626ac7832
Author: Brent Cook <[email protected]>
Date: Mon Jan 8 21:54:21 2024 -0600
Date: Sun Feb 4 22:53:59 2024 -0600

align sections on masm/windows to 64 bytes
align read-only sections on masm/windows to 64 bytes

Avoid conflicts where alignment is specified later in the underlying
assembly.

diff --git a/src/lib/libcrypto/perlasm/x86_64-xlate.pl b/src/lib/libcrypto/perlasm/x86_64-xlate.pl
index 5dbed2a8c..37dfcdbc9 100755
index 5dbed2a8c..d62780c2c 100755
--- a/src/lib/libcrypto/perlasm/x86_64-xlate.pl
+++ b/src/lib/libcrypto/perlasm/x86_64-xlate.pl
@@ -567,7 +567,7 @@ my %globals;
@@ -567,7 +567,13 @@ my %globals;
$v.="$line\tSEGMENT";
if ($line=~/\.([prx])data/) {
$v.=" READONLY";
- $v.=" ALIGN(".($1 eq "p" ? 4 : 8).")" if ($masm>=$masmref);
+ $v.=" ALIGN(64)";
+ if ($masm>=$masmref) {
+ if ($line=~/\.rdata/) {
+ $v.=" ALIGN(64)";
+ } else {
+ $v.=" ALIGN(".($1 eq "p" ? 4 : 8).")";
+ }
+ }
} elsif ($line=~/\.CRT\$/i) {
$v.=" READONLY ";
$v.=$masm>=$masmref ? "ALIGN(8)" : "DWORD";

0 comments on commit e9d9c93

Please sign in to comment.