From e195c8a2562baef0fdcae330556ed60b1e922b0e Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 10 May 2017 14:24:56 -0400 Subject: Remove filename argument to x86 asm_init. The assembler already knows the actual path to the generated file and, in other perlasm architectures, is left to manage debug symbols itself. Notably, in OpenSSL 1.1.x's new build system, which allows a separate build directory, converting .pl to .s as the scripts currently do result in the wrong paths. This also avoids inconsistencies from some of the files using $0 and some passing in the filename. Reviewed-by: Richard Levitte Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/3431) --- crypto/perlasm/README | 4 ++-- crypto/perlasm/x86asm.pl | 8 +++----- crypto/perlasm/x86gas.pl | 2 +- crypto/perlasm/x86masm.pl | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'crypto/perlasm') diff --git a/crypto/perlasm/README b/crypto/perlasm/README index e90bd8e014..3177c37165 100644 --- a/crypto/perlasm/README +++ b/crypto/perlasm/README @@ -9,7 +9,7 @@ require "x86asm.pl"; The first thing we do is setup the file and type of assembler -&asm_init($ARGV[0],$0); +&asm_init($ARGV[0]); The first argument is the 'type'. Currently 'cpp', 'sol', 'a.out', 'elf' or 'win32'. @@ -62,7 +62,7 @@ So a very simple version of this function could be coded as push(@INC,"perlasm","../../perlasm"); require "x86asm.pl"; - &asm_init($ARGV[0],"cacl.pl"); + &asm_init($ARGV[0]); &external_label("other"); diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index 1ff46c92cc..fef94b3076 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl @@ -8,7 +8,7 @@ # require 'x86asm.pl'; -# &asm_init(,"des-586.pl"[,$i386only]); +# &asm_init([,$i386only]); # &function_begin("foo"); # ... # &function_end("foo"); @@ -259,9 +259,8 @@ sub ::asm_finish } sub ::asm_init -{ my ($type,$fn,$cpu)=@_; +{ my ($type,$cpu)=@_; - $filename=$fn; $i386=$cpu; $elf=$cpp=$coff=$aout=$macosx=$win32=$netware=$mwerks=$android=0; @@ -301,8 +300,7 @@ EOF $pic=0; for (@ARGV) { $pic=1 if (/\-[fK]PIC/i); } - $filename =~ s/\.pl$//; - &file($filename); + &file(); } sub ::hidden {} diff --git a/crypto/perlasm/x86gas.pl b/crypto/perlasm/x86gas.pl index 2c8fce0779..5c7ea3880e 100644 --- a/crypto/perlasm/x86gas.pl +++ b/crypto/perlasm/x86gas.pl @@ -104,7 +104,7 @@ sub ::BC { @_; } sub ::DWC { @_; } sub ::file -{ push(@out,".file\t\"$_[0].s\"\n.text\n"); } +{ push(@out,".text\n"); } sub ::function_begin_B { my $func=shift; diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl index d352f47055..dffee76211 100644 --- a/crypto/perlasm/x86masm.pl +++ b/crypto/perlasm/x86masm.pl @@ -85,7 +85,6 @@ sub ::DWC { "@_"; } sub ::file { my $tmp=<<___; -TITLE $_[0].asm IF \@Version LT 800 ECHO MASM version 8.00 or later is strongly recommended. ENDIF -- cgit v1.2.3