Binary Rewriting without Relocation Information

Binary rewriting softwares transform executables by maintaining the original binary’s functionality, while improving it in one or more metrics, such as runtime performance, energy use, memory use, security, and reliability. Existing static binary rewriters are unable to rewrite binaries that do not contain relocation information, which is typically discarded by linkers unless specifically instructed otherwise. Unfortunately, most deployed binaries lack such information; hence they cannot be statically rewritten at all. We present a new approach to binary rewriting capable of rewriting binaries statically without relocation information. This is the first technology that allows for application of complex static transformations to any binary. This technology extends the power of binary rewriting technology past developers and into the hands of end-users. This technology has been incorporated into a working prototype known as SecondWrite, which has been used to rewrite and apply optimizations to a subset of SPEC benchmarks. Tests yielded reasonable overheads, with an average speedup of 27% for non-optimized binaries, and an average slowdown of 7% for optimized versions. Our tool can be used as a platform for complex optimization and security enhancements of any binary for the first time ever.

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

[2]  Barton P. Miller,et al.  Dynamic program instrumentation for scalable performance tools , 1994, Proceedings of IEEE Scalable High Performance Computing Conference.

[3]  Amitabh Srivastava,et al.  Analysis Tools , 2019, Public Transportation Systems.

[4]  Alec Wolman,et al.  Instrumentation and optimization of Win32/intel executables using Etch , 1997 .

[5]  Norman Rubin,et al.  Spike: an optimizer for alpha/NT executables , 1997 .

[6]  Robert S. Cohn,et al.  Optimizing Alpha Executables on Windows NT with Spike , 1998, Digit. Tech. J..

[7]  Emin Gün Sirer,et al.  Design and implementation of a distributed virtual machine for networked computers , 1999, SOSP.

[8]  Bart Demoen,et al.  On the Static Analysis of Indirect Control Transfers in Binaries , 2000, PDPTA.

[9]  Koen De Bosschere,et al.  alto: a link-time optimizer for the Compaq Alpha , 2001, Softw. Pract. Exp..

[10]  Amitabh Srivastava,et al.  Vulcan Binary transformation in a distributed environment , 2001 .

[11]  Joshua B. Fryman,et al.  Software caching using dynamic binary rewriting for embedded devices , 2002, Proceedings International Conference on Parallel Processing.

[12]  Sally A. McKee,et al.  METRIC: tracking down inefficiencies in the memory hierarchy via binary rewriting , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[13]  Richard Johnson,et al.  Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization , 2003 .

[14]  Mary Lou Soffa,et al.  Retargetable and reconfigurable software dynamic translation , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[15]  Derek Bruening,et al.  Efficient, transparent, and comprehensive runtime code manipulation , 2004 .

[16]  Úlfar Erlingsson,et al.  The Inlined Reference Monitor Approach to Security Policy Enforcement , 2004 .

[17]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[18]  Barton P. Miller,et al.  Practical analysis of stripped binary code , 2005, CARN.

[19]  K. De Bosschere,et al.  DIABLO: a reliable, retargetable and extensible link-time rewriting framework , 2005, Proceedings of the Fifth IEEE International Symposium on Signal Processing and Information Technology, 2005..

[20]  Koen De Bosschere,et al.  Link-time binary rewriting techniques for program compaction , 2005, TOPL.

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

[22]  Benjamin William Schwarz,et al.  Post Link-Time Optimization on the Intel IA-32 Architecture , 2005 .

[23]  Tzi-cker Chiueh,et al.  BIRD: binary interpretation using runtime disassembly , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[24]  Nicholas Nethercote,et al.  Valgrind: a framework for heavyweight dynamic binary instrumentation , 2007, PLDI '07.

[25]  Gregory R. Andrews,et al.  PLTO: A Link-Time Optimizer for the Intel IA-32 Architecture , 2007 .

[26]  Koen De Bosschere,et al.  Link-time compaction and optimization of ARM executables , 2007, TECS.

[27]  Wei Hu,et al.  Evaluating Indirect Branch Handling Mechanisms in Software Dynamic Translation Systems , 2007, CGO.

[28]  Rajeev Barua,et al.  Automatic Parallelization in a Binary Rewriter , 2010, 2010 43rd Annual IEEE/ACM International Symposium on Microarchitecture.