Fix up the .rodata segment's name for Windows as well.
authortb <tb@openbsd.org>
Thu, 23 Feb 2023 08:49:02 +0000 (08:49 +0000)
committertb <tb@openbsd.org>
Thu, 23 Feb 2023 08:49:02 +0000 (08:49 +0000)
Here we need .rdata with some alignment goo. Fortunately, this was already
present for .pdata and .xdata, so the change is easy. Also, this is a code
path that doesn't affect OpenBSD at all.

ok jsing miod

lib/libcrypto/perlasm/x86_64-xlate.pl

index 642fc00..5dbed2a 100755 (executable)
@@ -553,9 +553,10 @@ my %globals;
                /\.section/ && do { my $v=undef;
                                    $line =~ s/([^,]*).*/$1/;
                                    $line = ".CRT\$XCU" if ($line eq ".init");
+                                   $line = ".rdata" if ($line eq ".rodata");
                                    if ($nasm) {
                                        $v="section     $line";
-                                       if ($line=~/\.([px])data/) {
+                                       if ($line=~/\.([prx])data/) {
                                            $v.=" rdata align=";
                                            $v.=$1 eq "p"? 4 : 8;
                                        } elsif ($line=~/\.CRT\$/i) {
@@ -564,7 +565,7 @@ my %globals;
                                    } else {
                                        $v="$current_segment\tENDS\n" if ($current_segment);
                                        $v.="$line\tSEGMENT";
-                                       if ($line=~/\.([px])data/) {
+                                       if ($line=~/\.([prx])data/) {
                                            $v.=" READONLY";
                                            $v.=" ALIGN(".($1 eq "p" ? 4 : 8).")" if ($masm>=$masmref);
                                        } elsif ($line=~/\.CRT\$/i) {