perlasm: properly spell .rodata for macOS on intel
authortb <tb@openbsd.org>
Tue, 21 Feb 2023 12:24:39 +0000 (12:24 +0000)
committertb <tb@openbsd.org>
Tue, 21 Feb 2023 12:24:39 +0000 (12:24 +0000)
ok jsing

lib/libcrypto/perlasm/x86_64-xlate.pl

index bc9d78e..642fc00 100755 (executable)
@@ -504,6 +504,9 @@ my %globals;
                    $self->{value} = ".p2align\t" . (log($line)/log(2));
                } elsif ($dir eq ".section") {
                    $current_segment=$line;
+                   if (!$elf && $current_segment eq ".rodata") {
+                       if      ($flavour eq "macosx")  { $self->{value} = ".section\t__DATA,__const"; }
+                   }
                    if (!$elf && $current_segment eq ".init") {
                        if      ($flavour eq "macosx")  { $self->{value} = ".mod_init_func"; }
                        elsif   ($flavour eq "mingw64") { $self->{value} = ".section\t.ctors"; }