A retargetable static binary translator for the ARM architecture

Bor Yeh Shen, Wei Chung Hsu, Wuu Yang

Research output: Contribution to journalArticlepeer-review

23 Scopus citations

Abstract

Machines designed with new but incompatible Instruction Set Architecture (ISA) may lack proper applications. Binary translation can address this incompatibility by migrating applications from one legacy ISA to a new one, although binary translation has problems such as code discovery for variable-length ISA and code location issues for handling indirect branches. Dynamic Binary Translation (DBT) has been widely adopted for migrating applications since it avoids those problems. Static Binary Translation (SBT) is a less general solution and has not been actively researched. However, SBT performs more aggressive optimizations, which could yield more compact code and better code quality. Applications translated by SBT can consume less memory, processor cycles, and power than DBT and can be started more quickly. These advantages are even more critical for embedded systems than for general systems. In this article, we designed and implemented a new SBT tool, called LLBT, which translates ARM instructions into LLVM IRs and then retargets the LLVM IRs to various ISAs, including ×86, ×86-64 ARM, and MIPS. LLBT leverages two important functionalities from LLVM: comprehensive optimizations and retargetability. More importantly, LLBT solves the code discovery problem for ARM/Thumb binaries without resorting to interpretation. LLBT also effectively reduced the size of the address mapping table, making SBT a viable solution for embedded systems. Our experiments based on the EEMBC benchmark suite show that the LLBT-generated code can run more than 6× and 2.3× faster on average than emulation with QEMU and HQEMU, respectively.

Original languageEnglish
Article number18
JournalTransactions on Architecture and Code Optimization
Volume11
Issue number2
DOIs
StatePublished - 1 Jan 2014

Keywords

  • Binary translation
  • Compiler
  • Intermediate representation
  • Retargeting

Fingerprint

Dive into the research topics of 'A retargetable static binary translator for the ARM architecture'. Together they form a unique fingerprint.

Cite this