fix some typos
[openssl.git] / crypto / perlasm / x86gas.pl
index 5c2498118f9ff2d17db08157db5fc5667cd448c4..5c7ea3880e4d3965c6864c07ba5d940a39a4917d 100644 (file)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2007-2016 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 x86gas;
 
@@ -17,7 +24,7 @@ sub opsize()
 { my $reg=shift;
     if    ($reg =~ m/^%e/o)            { "l"; }
     elsif ($reg =~ m/^%[a-d][hl]$/o)   { "b"; }
-    elsif ($reg =~ m/^%[xm]/o)         { undef; }
+    elsif ($reg =~ m/^%[yxm]/o)                { undef; }
     else                               { "w"; }
 }
 
@@ -97,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;
@@ -183,9 +190,7 @@ sub ::align
 sub ::picmeup
 { my($dst,$sym,$base,$reflabel)=@_;
 
-    if (defined($base) && $sym eq "OPENSSL_ia32cap_P" && !$::macosx)
-    {  &::lea($dst,&::DWP("$sym-$reflabel",$base));    }
-    elsif (($::pic && ($::elf || $::aout)) || $::macosx)
+    if (($::pic && ($::elf || $::aout)) || $::macosx)
     {  if (!defined($base))
        {   &::call(&::label("PIC_me_up"));
            &::set_label("PIC_me_up");
@@ -198,6 +203,8 @@ sub ::picmeup
            &::mov($dst,&::DWP("$indirect-$reflabel",$base));
            $non_lazy_ptr{"$nmdecor$sym"}=$indirect;
        }
+       elsif ($sym eq "OPENSSL_ia32cap_P" && $::elf>0)
+       {   &::lea($dst,&::DWP("$sym-$reflabel",$base));   }
        else
        {   &::lea($dst,&::DWP("_GLOBAL_OFFSET_TABLE_+[.-$reflabel]",
                            $base));