提交 f586d971 编写于 作者: A Andy Polyakov

perlasm/ppc-xlate.pl: improve linux64le support.

Suggested by: Marcello Cerri
上级 a61e5122
...@@ -27,7 +27,8 @@ my $globl = sub { ...@@ -27,7 +27,8 @@ my $globl = sub {
/osx/ && do { $name = "_$name"; /osx/ && do { $name = "_$name";
last; last;
}; };
/linux.*32/ && do { $ret .= ".globl $name\n"; /linux.*(32|64le)/
&& do { $ret .= ".globl $name\n";
$ret .= ".type $name,\@function"; $ret .= ".type $name,\@function";
last; last;
}; };
...@@ -49,7 +50,9 @@ my $globl = sub { ...@@ -49,7 +50,9 @@ my $globl = sub {
$ret; $ret;
}; };
my $text = sub { my $text = sub {
($flavour =~ /aix/) ? ".csect" : ".text"; my $ret = ($flavour =~ /aix/) ? ".csect" : ".text";
$ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64le/);
$ret;
}; };
my $machine = sub { my $machine = sub {
my $junk = shift; my $junk = shift;
...@@ -64,8 +67,8 @@ my $size = sub { ...@@ -64,8 +67,8 @@ my $size = sub {
if ($flavour =~ /linux/) if ($flavour =~ /linux/)
{ shift; { shift;
my $name = shift; $name =~ s|^[\.\_]||; my $name = shift; $name =~ s|^[\.\_]||;
my $ret = ".size $name,.-".($flavour=~/64/?".":"").$name; my $ret = ".size $name,.-".($flavour=~/64$/?".":"").$name;
$ret .= "\n.size .$name,.-.$name" if ($flavour=~/64/); $ret .= "\n.size .$name,.-.$name" if ($flavour=~/64$/);
$ret; $ret;
} }
else else
...@@ -159,7 +162,10 @@ while($line=<>) { ...@@ -159,7 +162,10 @@ while($line=<>) {
{ {
$line =~ s|(^[\.\w]+)\:\s*||; $line =~ s|(^[\.\w]+)\:\s*||;
my $label = $1; my $label = $1;
printf "%s:",($GLOBALS{$label} or $label) if ($label); if ($label) {
printf "%s:",($GLOBALS{$label} or $label);
printf "\n.localentry\t$GLOBALS{$label},0" if ($GLOBALS{$label} && $flavour =~ /linux.*64le/);
}
} }
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册