Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
7b644df8
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b644df8
编写于
3月 30, 2015
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perlasm/arm-xlate.pl update (fix end-less loop and prepare for 32-bit iOS).
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
449e3f26
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
24 deletion
+49
-24
crypto/perlasm/arm-xlate.pl
crypto/perlasm/arm-xlate.pl
+49
-24
未找到文件。
crypto/perlasm/arm-xlate.pl
浏览文件 @
7b644df8
...
...
@@ -18,6 +18,32 @@ my $arch = sub {
if
(
$flavour
=~
/linux/
)
{
"
.arch
\t
"
.
join
('
,
',
@
_
);
}
else
{
"";
}
};
my
$fpu
=
sub
{
if
(
$flavour
=~
/linux/
)
{
"
.fpu
\t
"
.
join
('
,
',
@
_
);
}
else
{
"";
}
};
my
$hidden
=
sub
{
if
(
$flavour
=~
/ios/
)
{
"
.private_extern
\t
"
.
join
('
,
',
@
_
);
}
else
{
"
.hidden
\t
"
.
join
('
,
',
@
_
);
}
};
my
$comm
=
sub
{
my
@args
=
split
(
/,\s*/
,
shift
);
my
$name
=
@args
[
0
];
my
$global
=
\
$GLOBALS
{
$name
};
my
$ret
;
if
(
$flavour
=~
/ios32/
)
{
$ret
=
"
.comm
\t
_
$name
,
@args
[1]
\n
";
$ret
.=
"
.non_lazy_symbol_pointer
\n
";
$ret
.=
"
$name
:
\n
";
$ret
.=
"
.indirect_symbol
\t
_
$name
\n
";
$ret
.=
"
.long
\t
0
";
$name
=
"
_
$name
";
}
else
{
$ret
=
"
.comm
\t
"
.
join
('
,
',
@args
);
}
$$global
=
$name
;
$ret
;
};
my
$globl
=
sub
{
my
$name
=
shift
;
my
$global
=
\
$GLOBALS
{
$name
};
...
...
@@ -64,44 +90,43 @@ sub range {
join
("
,
",
map
("
$r$_$sfx
",(
$start
..
$end
)));
}
sub
parse_args
{
sub
expand_line
{
my
$line
=
shift
;
my
@ret
=
();
pos
(
$line
)
=
0
;
while
(
1
)
{
if
(
$line
=~
m/\G\[/gc
)
{
$line
=~
m/\G([^\]]+\][^,]*)\s*/g
;
push
@ret
,"
[$1
";
while
(
$line
=~
m/\G[^@\/\{\"]*/g
)
{
if
(
$line
=~
m/\G(@|\/\/|$)/gc
)
{
last
;
}
elsif
(
$line
=~
m/\G\{/gc
)
{
$line
=~
m/\G([^\}]+\}[^,]*)\s*/g
;
my
$arg
=
$
1
;
$arg
=~
s/([rdqv])([0-9]+)([^\-]*)\-\1([0-9]+)\3/range($1,$3,$2,$4)/g
e
;
push
@ret
,"
{
$arg
"
;
my
$saved_pos
=
pos
(
$line
)
;
$line
=~
s/\G([rdqv])([0-9]+)([^\-]*)\-\1([0-9]+)\3/range($1,$3,$2,$4)/
e
;
pos
(
$line
)
=
$saved_pos
;
$line
=~
m/\G[^\}]*\}/g
;
}
elsif
(
$line
=~
m/\G
([^,]+)\s*/g
)
{
push
@ret
,
$
1
;
elsif
(
$line
=~
m/\G
\"/gc
)
{
$line
=~
m/\G[^\"]*\"/g
;
}
last
if
(
$line
=~
m/\G$/gc
);
$line
=~
m/\G,\s*/g
;
}
map
{
my
$s
=
$_
;
$s
=~
s/\b(\w+)/$GLOBALS{$1} or $1/g
e
;
$s
}
@ret
;
$line
=~
s/\b(\w+)/$GLOBALS{$1} or $1/g
e
;
return
$line
;
}
while
(
$line
=<>
)
{
if
(
$line
=~
m/^\s*(#|@|\/\/)/
)
{
print
$line
;
next
;
}
$line
=~
s|/\*.*\*/||
;
# get rid of C-style comments...
$line
=~
s|^\s+||
;
# ... and skip white spaces in beginning...
$line
=~
s|\s+$||
;
# ... and at the end
{
$line
=~
s|[\b\.]L(\w
+
)|L$1|g
;
# common denominator for Locallabel
$line
=~
s|\bL(\w
+
)|\.L$1|g
if
(
$dotinlocallabels
);
$line
=~
s|[\b\.]L(\w
{2,}
)|L$1|g
;
# common denominator for Locallabel
$line
=~
s|\bL(\w
{2,}
)|\.L$1|g
if
(
$dotinlocallabels
);
}
{
...
...
@@ -112,24 +137,24 @@ while($line=<>) {
}
}
if
(
$line
!~
m/^
#/o
)
{
$line
=~
s|^\s*(\.?)(\S+)\s*||
o
;
if
(
$line
!~
m/^
[#@]/
)
{
$line
=~
s|^\s*(\.?)(\S+)\s*||
;
my
$c
=
$
1
;
$c
=
"
\t
"
if
(
$c
eq
"");
my
$mnemonic
=
$
2
;
my
$opcode
;
if
(
$mnemonic
=~
m/([^\.]+)\.([^\.]+)/
o
)
{
if
(
$mnemonic
=~
m/([^\.]+)\.([^\.]+)/
)
{
$opcode
=
eval
("
\$
$1_$2
");
}
else
{
$opcode
=
eval
("
\$
$mnemonic
");
}
my
@args
=
parse_args
(
$line
);
my
$arg
=
expand_line
(
$line
);
if
(
ref
(
$opcode
)
eq
'
CODE
')
{
$line
=
&$opcode
(
@args
);
$line
=
&$opcode
(
$arg
);
}
elsif
(
$mnemonic
)
{
$line
=
$c
.
$mnemonic
;
$line
.=
"
\t
"
.
join
('
,
',
@args
)
if
(
$#args
>=
0
);
$line
.=
"
\t
$arg
"
if
(
$arg
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录