ports/security/rust-ring/patches/patch-crypto_perlasm_x86_64-xlate_pl

35 lines
1.3 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: crypto/perlasm/x86_64-xlate.pl
--- crypto/perlasm/x86_64-xlate.pl.orig
+++ crypto/perlasm/x86_64-xlate.pl
@@ -788,6 +788,9 @@ my %globals;
} elsif ($dir eq ".section") {
$current_segment=$$line;
if (!$elf && $current_segment eq ".init") {
+ 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"; }
}
@@ -839,9 +842,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) {
@@ -850,7 +854,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) {