DisIRer: Converting a retargetable compiler into a multiplatform binary translator

This article proposes an alternative yet effective way of constructing a multiplatform binary translator, by converting a retargetable compiler into a binary translator. The rationale is that a retargetable compiler usually parses source programs into an Intermediate Representation (IR), and then translates IR into object code of different targets after performing analysis and optimizations. Specifically, the mechanism of code generation for multiple platforms from IR is already in place, and the missing link of building a multiplatform binary translator is a tool to transform binary programs back into IR. In order to fill in this missing link, this article presents a tool, called the disIRer. Just as a translator from machine language to assembly language is called a disassembler, a tool that translates executable binary programs to IR is called here a disIRer. The unique feature of this approach is that the retargetability of the binary translator is inherited directly from the retargetable compiler. A prototype multiplatform binary translator has been implemented upon GCC (the GNU Compiler Collection). DisIRer first converts binary programs back into GCC IR (Intermediate Representation), and afterward the GCC backend translates the IR to target binary programs of specified platforms. Experimental results show that x86 binary programs can be translated by this technique into ARM and Alpha binaries with reasonable code density and quality.

[1]  Michael Gschwind,et al.  Dynamic and Transparent Binary Translation , 2000, Computer.

[2]  Erik R. Altman,et al.  Daisy: Dynamic Compilation For 10o?40 Architectural Compatibility , 1997, Conference Proceedings. The 24th Annual International Symposium on Computer Architecture.

[3]  Miodrag Potkonjak,et al.  MediaBench: a tool for evaluating and synthesizing multimedia and communications systems , 1997, Proceedings of 30th Annual International Symposium on Microarchitecture.

[4]  James E. Smith,et al.  Virtual machines - versatile platforms for systems and processes , 2005 .

[5]  Vasanth Bala,et al.  Transparent Dynamic Optimization: The Design and Implementation of Dynamo , 1999 .

[6]  Erik R. Altman,et al.  Advances and future challenges in binary translation and optimization , 2001, Proc. IEEE.

[7]  Erik R. Altman,et al.  LaTTe: a Java VM just-in-time compiler with fast and efficient register allocation , 1999, 1999 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.PR00425).

[8]  Cristina Cifuentes,et al.  Binary translation: static, dynamic, retargetable? , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[9]  Barron C. Housel,et al.  A methodology for machine language decompilation , 1974, ACM '74.

[10]  Michael Gschwind,et al.  Dynamic Binary Translation and Optimization , 2001, IEEE Trans. Computers.

[11]  Jens Tröger,et al.  Specification-driven dynamic binary translation , 2005 .

[12]  Cristina Cifuentes,et al.  UQBT: Adaptive Binary Translation at Low Cost , 2000, Computer.

[13]  Seung-Soon Im,et al.  Tool interface standard (TIS) executable and linking format (ELF) specification , 1995 .

[14]  Richard Johnson,et al.  The Transmeta Code Morphing/spl trade/ Software: using speculation, recovery, and adaptive retranslation to address real-life challenges , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[15]  Richard Johnson,et al.  The Transmeta Code Morphing#8482; Software: using speculation, recovery, and adaptive retranslation to address real-life challenges , 2003, CGO.

[16]  C. May Mimic: a fast system/370 simulator , 1987, PLDI 1987.

[17]  Toshiaki Yasue,et al.  Design and evaluation of dynamic optimizations for a Java just-in-time compiler , 2005, TOPL.

[18]  David W. Wall,et al.  A practical system fljr intermodule code optimization at link-time , 1993 .

[19]  R. Bedicheck Some efficient architecture simulation tech-niques , 1990 .

[20]  John D. Bagley Special Feature: Microprogrammable Virtual Machines , 1976, Computer.

[21]  Hanspeter Mössenböck,et al.  Design of the Java HotSpot#8482; client compiler for Java 6 , 2008, TACO.

[22]  WimmerChristian,et al.  Design of the Java HotSpot client compiler for Java 6 , 2008 .

[23]  Kristy Andrews,et al.  Migrating a CISC computer family onto RISC via object code translation , 1992, ASPLOS V.

[24]  Todd M. Austin,et al.  SimpleScalar: An Infrastructure for Computer System Modeling , 2002, Computer.

[25]  Bo Huang,et al.  Optimizing dynamic binary translation for SIMD instructions , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[26]  James R. Larus,et al.  EEL: machine-independent executable editing , 1995, PLDI '95.

[27]  John Aycock,et al.  A brief history of just-in-time , 2003, CSUR.

[28]  Mendel Rosenblum,et al.  Embra: fast and flexible machine simulation , 1996, SIGMETRICS '96.

[29]  Paolo Faraboschi,et al.  DELI: a new run-time control point , 2002, MICRO.

[30]  Robert Wilson,et al.  Compiling Java just in time , 1997, IEEE Micro.

[31]  David Keppel,et al.  Shade: a fast instruction-set simulator for execution profiling , 1994, SIGMETRICS.

[32]  Joy Kamunyori Handling self-modifying code using software dynamic translation , 2007, TAPIA '07.

[33]  Richard L. Sites,et al.  Binary translation , 1993, CACM.

[34]  Cindy Zheng,et al.  PA-RISC to IA-64: Transparent Execution, No Recompilation , 2000, Computer.

[35]  Erik R. Altman,et al.  Welcome to the Opportunities of Binary Translation , 2000, Computer.

[36]  Mike Van,et al.  UQBT: Adaptable Binary Translation at Low Cost , 2000 .

[37]  K. Ebcioglu,et al.  Daisy: Dynamic Compilation For 10o?40 Architectural Compatibility , 1997, Conference Proceedings. The 24th Annual International Symposium on Computer Architecture.

[38]  Sanjay Bhansali,et al.  Framework for instruction-level tracing and analysis of program executions , 2006, VEE '06.

[39]  Richard M. Stallman,et al.  GNU Compiler Collection Internals , 2011 .

[40]  Steven J. Vaughan-Nichols,et al.  New Approach to Virtualization Is a Lightweight , 2006, Computer.

[41]  Tao Zhang,et al.  Binary translation to improve energy efficiency through post-pass register re-allocation , 2004, EMSOFT '04.

[42]  Z. Segall,et al.  Timing insensitive binary-to-binary migration across multiprocessor architectures , 1995, Proceedings of Third Workshop on Parallel and Distributed Real-Time Systems.

[43]  Harish Patil,et al.  Pin: building customized program analysis tools with dynamic instrumentation , 2005, PLDI '05.

[44]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .

[45]  John Yates,et al.  FX!32 a profile-directed binary translator , 1998, IEEE Micro.

[46]  James E. Smith,et al.  Dynamic binary translation for accumulator-oriented architectures , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[47]  Stephen Roderick Hines,et al.  Using de-optimization to re-optimize code , 2005, EMSOFT.

[48]  Vasanth Bala,et al.  Dynamo: a transparent dynamic optimization system , 2000, SIGP.

[49]  Hausi A. Müller,et al.  Proceedings of the International Conference on Software Maintenance , 1994 .

[50]  Cathy May,et al.  Mimic: a fast system/370 simulator , 1987, SIGPLAN '87.

[51]  Cristina Cifuentes,et al.  Machine-adaptable dynamic binary translation , 2000 .

[52]  Jonathan Grudin,et al.  Design and evaluation , 1995 .

[53]  Michael Van Emmerik,et al.  Static single assignment for decompilation , 2007 .

[54]  Cristina Cifuentes,et al.  Machine-adaptable dynamic binary translation , 2000, Dynamo.

[55]  Robert J. Creasy,et al.  The Origin of the VM/370 Time-Sharing System , 1981, IBM J. Res. Dev..