作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2006, Vol. 32 ›› Issue (23): 49-51. doi: 10.3969/j.issn.1000-3428.2006.23.018

• 软件技术与数据库 • 上一篇    下一篇

IA-64代码翻译中的跳转表恢复技术

齐 宁,赵荣彩   

  1. (解放军信息工程大学计算机系,郑州 450002)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2006-12-05 发布日期:2006-12-05

Jump Table Recovery Technique in IA-64 Binary Code Translation

QI Ning, ZHAO Rongcai   

  1. (Department of Computer, PLA Information and Engineering University, Zhengzhou 450002)
  • Received:1900-01-01 Revised:1900-01-01 Online:2006-12-05 Published:2006-12-05

摘要: 在对IA-64二进制代码进行翻译的过程中,一个重要的问题就是识别和恢复通过跳转表实现的switch语句。分析了编译器生成跳转表时采用的策略,提出了前向预取同反向切片及表达式置换相结合以识别和恢复switch语句的技术,归纳了用于获取跳转表地址的规格化形式,给出了跳转表分支目标地址恢复方法,从而可将包含跳转表的IA-64二进制代码恢复为高级switch语句。该技术已经在二进制翻译框架I2A上进行了测试,可以处理编译器gcc 2.96及gcc 3.2.3在多种优化级别下生成的IA-64代码。

关键词: IA-64, 跳转表, 切片, 表达式置换

Abstract: In the translation of IA-64 binary code, one of the important problems is that of recognizing the switch statements implemented via jump table. The paper first analyzes the compiler’s strategies when creating jump table, then presents a technique for recognizing and recovering switch statements by combination of forward prefetch and backwards slicing plus expression substitution, reduces to a normal form which allows people to determine where the jump table is located, proposes a method to recovery the target addresses of jump table. Using such a technique, it can translate the IA-64 binary code that contains jump table into high level switch statements. The presented technique is tested in a binary translation framework I2A. The test shows that the technique is suitable for IA-64 binary code generated by compiler gcc 2.96 and gcc 3.2.3 with multi optimization options.

Key words: IA-64, Jump table, Slicing, Expression substitution