Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

DisIRer: Converting a retargetable compiler into a multiplatform binary translator

Published: 30 December 2010 Publication History

Abstract

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.

References

[1]
Aho, A. V., Lam, M. S., Sethi, R., and Ullman, J. D. 2007. Compilers: Principles, Techniques, and Tools 2nd Ed. Addison Wesley.
[2]
Altman, E. R., Ebcioğlu, K., Gschwin, M., and Sathaye, S. 2001. Advances and future challenges in binary translation and optimization. Proc. IEEE 89, 11, 1710--1722.
[3]
Altman, E. R., Kaeli, D., and Sheffer, Y. 2000. Welcome to the opportunities of binary translation. IEEE Comput. 33, 3, 40--45.
[4]
Andrews, K. and Sand, D. 1992. Migrating a CISC computer family onto RISC via object code translation. In Proceedings of the 5th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-V). 213--222.
[5]
Austin, T., Larson, E., and Ernst, D. 2002. SimpleScalar: An infrastructure for computer system modeling. IEEE Comput. 35, 2, 59--67.
[6]
Aycock, J. 2003. A brief history of just-in-time. ACM Comput. Surv. 35, 2, 97--113.
[7]
Bagley, J. D. 1976. Special feature: Microprogrammable virtual machines. IEEE Comput. 9, 2, 38--42.
[8]
Bala, V., Duesterwald, E., and Banerjia, S. 1999. Transparent dynamic optimization: The design and implementation of dynamo. Tech. rep. HPL-1999-78, HP Laboratories.
[9]
Bala, V., Duesterwald, E., and Banerjia, S. 2000. Dynamo: A transparent dynamic optimization system. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 1--12.
[10]
Bedichek, R. 1990. Some efficient architecture simulation techniques. In Proceedings of the Winter USENIX Conference. 53--63.
[11]
Bergh, A. B., Keilman, K., Magenheimer, D. J., and Miller, J. A. 1987. HP 3000 emulation on HP precision architecture computers. Hewlett-Packard J. 87--89.
[12]
Bhansali, S., Chen, W.-K., de Jong, S., Edwards, A., Murray, R., Drinić, M., Miho&cbreve;ka, D., and Chau, J. 2006. Framework for instruction-level tracing and analysis of program executions. In Proceedings of the Virtual Execution Environments Conference. 154--163.
[13]
Chernoff, A., Herdeg, M., Hookway, R., Reeve, C., Rubin, N., Tye, T., Yadavalli, S. B., and Yates, J. 1998. Fx!32: A profile-directed binary translator. IEEE Micro 18, 2, 56--64.
[14]
Cifuentes, C. and Emmerik, M. V. 2000. UQBT: Adaptable binary translation at low cost. IEEE Comput. 33, 3, 60--66.
[15]
Cifuentes, C. and Malhotra, V. 1996. Binary translation: Static, dynamic, retargetable? In Proceedings of the International Conference on Software Maintenance. 340--349.
[16]
Cmelik, B. and Keppe, D. 1994. Shade: A fast instruction-set simulator for execution profiling. In Proceedings ACM SIGMETRICS Conference on Measurement and Modeling of Computer Systems. 128--137.
[17]
Cogswell, B. and Segall, Z. 1995. Timing insensitive binary-to-binary migration across multiprocessor architectures. In Proceedings of the 3rd Workshop on Parallel and Distributed Real-Time Systems. 193--194.
[18]
Cramer, T., Friedman, R., Miller, T., Seberger, D., Wilson, R., and Wolczko, M. 1997. Compiling java just in time. IEEE Micro 17, 3, 36--43.
[19]
Creasy, R. J. 1981. The origin of the VM/370 time-sharing system. IBM J. Res. Devel. 25, 5, 483--490.
[20]
Dehnert, J. C., Grant, B. K., Banning, J. P., Johnson, R., Kistler, T., Klaiber, A., and Mattson, J. 2003. The Transmeta code morphing software: Using speculation, recovery, and adaptive retranslation to address real-life challenges. In Proceedings of the International Symposium on Code Generation and Optimization (CGO'03). 15--24.
[21]
Desoli, G., Mateev, N., Duesterwald, E., Faraboschi, P., and Fisher, J. A. 2002. DELI: A new runtime control point. In Proceedings of the 35th Annual ACM/IEEE International Symposium on Microarchitecture. 257--268.
[22]
Digital. 1995. Freeport express. http://www.novalink.com/freeport-express/.
[23]
Ebcioglu, K., Member, S., Altman, E., Gschwind, M., and Sathaye, S. 2001. Dynamic binary translation and optimization. IEEE Trans. Comput. 50, 6, 529--548.
[24]
Ebcioğlu, K. and Altman, E. R. 1997. DAISY: Dynamic compilation for 100% architectural compatibility. In Proceedings of the 24th Annual International Symposium on Computer Architecture. 26--37.
[25]
Emmerik, M. J. V. 2007. Static single assignment for decompilation. Ph.D. thesis, The University of Queensland.
[26]
GCC. The GNU compiler collection. http://gcc.gnu.org/.
[27]
GNU. GNU binary utilities (GNU binutils). http://www.gnu.org/software/binutils/.
[28]
Gschwind, M., Altman, E. R., Sathaye, S., Ledak, P., and Appenzeller, D. 2000. Dynamic and transparent binary translation. IEEE Comput. 33, 3, 54--59.
[29]
Hines, S., Kulkarni, P., Whalley, D., and Davidson, J. 2005. Using de-optimization to re-optimize code. In Proceedings of EMSOFT'05. 114--123.
[30]
Hines, S. R. 2004. Using de-optimization to re-optimize code. M.S. thesis, The Florida State University.
[31]
Housel, B. C. and Halstead, M. H. 1974. A methodology for machine language decompilation. In Proceedings of the ACM Annual Conference Vol. 1, 254--260.
[32]
Intel Corporation. Intel C++ compiler for linux, i486 platform. http://software.intel.com/en-us/articles/intel-c-compiler-professional-edition-for-linux-documentation/
[33]
Kamunyori, J. W. 2007. Handling self-modifying code using software dynamic translation. In Proceedings of the Conference on Diversity in Computing. 32--32.
[34]
Kim, H.-S. and Smith, J. E. 2003. Dynamic binary translation for accumulator-oriented architectures. In Proceedings of the International Symposium on Code Generation and Optimization (CGO'03). 25--35.
[35]
Kotzmann, T., Wimmer, C., Mo&suml;senbo&cuml;k, H., Rodriguez, T., Russell, K., and Cox, D. 2008. Design of the Java HotSpot client compiler for Java 6. ACM Trans. Architec. Code Optim. 5, 1.
[36]
Larus, J. R. and Schnarr, E. 1995. EEL: Machine-Independent executable editing. In Proceedings of SIGPLAN Conference on Programming Languages, Design and Implementation. 291--300.
[37]
Lee, C., Potkonjak, M., and Mangione-Smith, W. H. 1997. MediaBench: A tool for evaluating and synthesizing multimedia and communication systems. In Proceedings of the 30th Annual ACM/IEEE International Symposium on Microarchitecture. 330--335.
[38]
Li, J., Zhang, Q., Xu, S., and Huang, B. 2006. Optimizing dynamic binary translation for simd instructions. In Proceedings of the International Symposium on Code Generation and Optimization (CGO'06). 269--280.
[39]
Lin, T.-Y., Chang, R.-G., and Hwang, Y.-S. 2008. DisIRer. In Proceedings of 14th Workshop on Compiler Techniques for High-Performance Computing.
[40]
Luk, C.-K., Cohn, R., Muth, R., Patil, H., Klauser, A., Lowney, G., Wallace, S., Reddi, V. J., and Hazelwood, K. 2005. Pin: Building customized program analysis tools with dynamic instrumentation. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 190--200.
[41]
May, C. 1987. MIMIC: A fast System/370 simulator. In Proceedings of SIGPLAN'87 Symposium on Interpreters and Interpretive Techniques. 1--13.
[42]
Microsoft. Phoenix. http://research.microsoft.com/Phoenix/.
[43]
Red Hat Inc. Cygwin. http://www.cygwin.com/.
[44]
Sites, R., Chernoff, A., Kirk, M., Marks, M., and Robinson, S. 1993. Binary translation. Comm. ACM 36, 2, 69--81.
[45]
Smith, J. and Nair, R. 2005. Virtual Machines: Versatile Platforms for Systems and Processes. Morgan Kaufmann.
[46]
Srivastava, A. and Eustace, A. 1994. Atom: A system for building customized program analysis tools. In Proceedings of the SIGPLAN Conference on Programming Languages and Implementation (PLDI'94). 196--205.
[47]
Srivastava, A. and Wall, D. W. 1992. A practical system for intermodule code optimization at link-time. Tech. rep. WRL-92-6, Digital Western Research Laboratory. December.
[48]
Stallman, R. and the GCC Developer Community. GNU compiler collection internals. http://gcc.gnu.org/onlinedocs/gccint/.
[49]
Suganuma, T., Yasue, T., Kawahito, M., Komatsu, H., and Nakatani, T. 2005. Design and evaluation of dynamic optimizations for a java just-in-time compiler. ACM Trans. Program. Lang. Syst. 27, 4, 732--785.
[50]
Thompson, T. 1996. An Alpha in PC clothing. In Byte. 195--196.
[51]
TIS. 1995. Tool interface standard (TIS) executable and linking format (ELF) specification, version 1.2. http://refspecs.freestandards.org/elf/elf.pdf
[52]
Tröger, J. 2005. Specification-driven dynamic binary translation. Ph.D. thesis, Queensland University of Technology.
[53]
Ung, D. and Cifuentes, C. 2000. Machine-Adaptable dynamic binary translation. In Proceedings of the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization. 41--51.
[54]
Vaughan-Nichols, S. J. 2006. New approach to virtualization is a lightweight. IEEE Comput. 39, 11, 12--14.
[55]
Witchel, E. and Rosenblum, M. 1996. Embra: Fast and flexible machine simulation. In Proceedings of the ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Systems. 68--79.
[56]
Yang, B.-S., Moon, S.-M., Park, S., Lee, J., Lee, S., Park, J., Chung, Y. C., Kim, S., Ebcioglu, K., and Altman, E. 1999. LaTTe: A Java VM just-in-time compiler with fast and efficient register allocation. In Proceedings of International Conference on Parallel Architectures and Compilation Techniques. 128--138.
[57]
Zhang, K., Zhang, T., and Pande, S. 2004. Binary translation to improve energy efficiency through post-pass register re-allocation. In Proceedings of the 4th ACM International Conference on Embedded Software. 74--85.
[58]
Zheng, C. and Thompson, C. 2000. PA-RISC to IA-64: Transparent execution, no recompilation. IEEE Comput. 33, 3, 47--52.
[59]
Zivojnović, V., Velarde, J. M., Schläger, C., and Meyr, H. 1994. DSPstone: A DSP-oriented benchmarking methodology. In Proceedings of the International Conference on Signal Processing Applications and Technology.

Cited By

View all
  • (2021)Legacy software migration based on timing contract aware real-time execution environmentsJournal of Systems and Software10.1016/j.jss.2020.110849172(110849)Online publication date: Feb-2021
  • (2020)Static/dynamic real-time legacy software migrationProceedings of the Conference on Rapid Simulation and Performance Evaluation: Methods and Tools10.1145/3375246.3375257(1-8)Online publication date: 21-Jan-2020
  • (2018)Real-Time Capable Retargeting of Xilinx MicroBlaze Binaries using QEMUProceedings of the Rapido'18 Workshop on Rapid Simulation and Performance Evaluation: Methods and Tools10.1145/3180665.3180671(1-8)Online publication date: 22-Jan-2018
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Architecture and Code Optimization
ACM Transactions on Architecture and Code Optimization  Volume 7, Issue 4
December 2010
167 pages
ISSN:1544-3566
EISSN:1544-3973
DOI:10.1145/1880043
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 December 2010
Accepted: 01 August 2010
Revised: 01 January 2010
Received: 01 March 2008
Published in TACO Volume 7, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Binary translation
  2. intermediate representation
  3. retargeting

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)252
  • Downloads (Last 6 weeks)12
Reflects downloads up to 25 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2021)Legacy software migration based on timing contract aware real-time execution environmentsJournal of Systems and Software10.1016/j.jss.2020.110849172(110849)Online publication date: Feb-2021
  • (2020)Static/dynamic real-time legacy software migrationProceedings of the Conference on Rapid Simulation and Performance Evaluation: Methods and Tools10.1145/3375246.3375257(1-8)Online publication date: 21-Jan-2020
  • (2018)Real-Time Capable Retargeting of Xilinx MicroBlaze Binaries using QEMUProceedings of the Rapido'18 Workshop on Rapid Simulation and Performance Evaluation: Methods and Tools10.1145/3180665.3180671(1-8)Online publication date: 22-Jan-2018
  • (2016)Detecting rootkits with the RAI runtime application inventoryProceedings of the 6th Workshop on Software Security, Protection, and Reverse Engineering10.1145/3015135.3015138(1-12)Online publication date: 5-Dec-2016
  • (2016)Lifting Assembly to Intermediate RepresentationACM SIGARCH Computer Architecture News10.1145/2980024.287238044:2(311-324)Online publication date: 25-Mar-2016
  • (2016)Lifting Assembly to Intermediate RepresentationACM SIGOPS Operating Systems Review10.1145/2954680.287238050:2(311-324)Online publication date: 25-Mar-2016
  • (2016)Lifting Assembly to Intermediate RepresentationACM SIGPLAN Notices10.1145/2954679.287238051:4(311-324)Online publication date: 25-Mar-2016
  • (2016)Extracting instruction semantics via symbolic execution of code generatorsProceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2950290.2950335(301-313)Online publication date: 1-Nov-2016
  • (2016)Lifting Assembly to Intermediate RepresentationProceedings of the Twenty-First International Conference on Architectural Support for Programming Languages and Operating Systems10.1145/2872362.2872380(311-324)Online publication date: 25-Mar-2016
  • (2016)Re-constructing high-level information for language-specific binary re-optimizationProceedings of the 2016 International Symposium on Code Generation and Optimization10.1145/2854038.2854057(273-283)Online publication date: 29-Feb-2016
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media