Latest update.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
|
||||
package x86_64support;
|
||||
|
||||
# require "x86_64-support.pl";
|
||||
# $ptr_size=&pointer_size($flavour);
|
||||
# $ptr_reg=&pointer_register($flavour,$reg);
|
||||
|
||||
sub ::pointer_size
|
||||
{
|
||||
my($flavour)=@_;
|
||||
my $ptr_size=8; $ptr_size=4 if ($flavour eq "elf32");
|
||||
return $ptr_size;
|
||||
}
|
||||
|
||||
sub ::pointer_register
|
||||
{
|
||||
my($flavour,$reg)=@_;
|
||||
if ($flavour eq "elf32") {
|
||||
if ($reg eq "%rax") {
|
||||
return "%eax";
|
||||
} elsif ($reg eq "%rbx") {
|
||||
return "%ebx";
|
||||
} elsif ($reg eq "%rcx") {
|
||||
return "%ecx";
|
||||
} elsif ($reg eq "%rdx") {
|
||||
return "%edx";
|
||||
} elsif ($reg eq "%rdi") {
|
||||
return "%edi";
|
||||
} elsif ($reg eq "%rsi") {
|
||||
return "%esi";
|
||||
} elsif ($reg eq "%rbp") {
|
||||
return "%ebp";
|
||||
} elsif ($reg eq "%rsp") {
|
||||
return "%esp";
|
||||
} else {
|
||||
return $reg."d";
|
||||
}
|
||||
} else {
|
||||
return $reg;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -83,6 +83,10 @@ my $PTR=" PTR";
|
||||
my $nasmref=2.03;
|
||||
my $nasm=0;
|
||||
|
||||
# GNU as indicator, as opposed to $gas, which indicates acceptable
|
||||
# syntax
|
||||
my $gnuas=0;
|
||||
|
||||
if ($flavour eq "mingw64") { $gas=1; $elf=0; $win64=1;
|
||||
$prefix=`echo __USER_LABEL_PREFIX__ | $ENV{CC} -E -P -`;
|
||||
$prefix =~ s|\R$||; # Better chomp
|
||||
@@ -100,6 +104,17 @@ elsif (!$gas)
|
||||
$elf=0;
|
||||
$decor="\$L\$";
|
||||
}
|
||||
# Find out if we're using GNU as
|
||||
elsif (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
|
||||
=~ /GNU assembler version ([2-9]\.[0-9]+)/)
|
||||
{
|
||||
$gnuas=1;
|
||||
}
|
||||
elsif (`$ENV{CC} --version 2>/dev/null`
|
||||
=~ /clang .*/)
|
||||
{
|
||||
$gnuas=1;
|
||||
}
|
||||
|
||||
my $cet_property;
|
||||
if ($flavour =~ /elf/) {
|
||||
@@ -108,14 +123,21 @@ if ($flavour =~ /elf/) {
|
||||
# with Intel CET support in order for linker to mark output with
|
||||
# Intel CET support.
|
||||
my $p2align=3; $p2align=2 if ($flavour eq "elf32");
|
||||
my $section='.note.gnu.property, #alloc';
|
||||
$section='".note.gnu.property", "a"' if $gnuas;
|
||||
$cet_property = <<_____;
|
||||
.section ".note.gnu.property", "a"
|
||||
.section $section
|
||||
.p2align $p2align
|
||||
.long 1f - 0f
|
||||
.long 4f - 1f
|
||||
.long 5
|
||||
0:
|
||||
.asciz "GNU"
|
||||
# "GNU" encoded with .byte, since .asciz isn't supported
|
||||
# on Solaris.
|
||||
.byte 0x47
|
||||
.byte 0x4e
|
||||
.byte 0x55
|
||||
.byte 0
|
||||
1:
|
||||
.p2align $p2align
|
||||
.long 0xc0000002
|
||||
|
||||
Reference in New Issue
Block a user