OS Supports of an LLVM-Based Retargetable Hybrid Binary Translator for X86 ISA

碩士 === 國立交通大學 === 資訊科學與工程研究所 === 101 === The main purpose of a binary translator (BT) is to translate an executable from a source instruction set architecture (ISA) to a target ISA, for example, ARM to X86. In fact, each kind of BTs has its merits and disadvantages. A static binary translator (SBT)...

Full description

Bibliographic Details
Main Authors: Liu, I-Chun, 劉億峻
Other Authors: Shann, Jyh-Jiun
Format: Others
Language:en_US
Published: 2013
Online Access:http://ndltd.ncl.edu.tw/handle/94751508549211072732
Description
Summary:碩士 === 國立交通大學 === 資訊科學與工程研究所 === 101 === The main purpose of a binary translator (BT) is to translate an executable from a source instruction set architecture (ISA) to a target ISA, for example, ARM to X86. In fact, each kind of BTs has its merits and disadvantages. A static binary translator (SBT) translates the source executable at static time, and thus may perform more aggressive optimization. Although SBT has the merit of the target executable performance, it can not perfectly handle some problems occurred at runtime, such as code discovery problem and code location problem. A dynamic binary translator (DBT) translates the source executable at runtime and thus it can handle code discovery problem and code location problem efficiently. However, since the translation time of a DBT is part of its execution time, it can not do aggressive optimizations. A hybrid binary translator (HBT) may have both the merits of SBT and DBT. An HBT translates the source executable first at static time, and then, if the execution of the target executable emits an exception at runtime, it may switch to its dynamic translator to handle the exception. Therefore, HBT has the merits of both good performance and easy handling of code discovery problem and code location problem. HBT is a brand-new binary translation technique and MC2LLVM is the only example in literature. MC2LLVM is an LLVM based retargetable HBT which supports ARM source ISA only currently. In this thesis, we extend MC2LLVM to support X86 source ISA and emulate the execution behavior of an X86 executable under Linux operation system. Compare to ARM ISA, X86 ISA is more complicated, and it has more instructions need to be implemented. Besides, the execution behavior of an X86 executable is also more complicated, such as multiple memory addressing modes and the design of fast system call. So adding the support of X86 source ISA is not easy. Because there are many applications are developed in X86, the support of X86 source ISA is valuable. In our X86-32 to X86-64 translation experiments, the target executables translated by our HBT are 1.6 times faster than QEMU on most programs of EEMBC benchmark.