A Retargetable Approach for Linking Native Shared Libraries in Binary Translation
|關鍵字:||二元轉譯;可重定目標;動態連結;binary translation;retargetable;dynamic linking|
|摘要:||二元轉譯是一種對移植應用程式到不同指令集常用的手段，動態連結共享函式庫也是經常被使用在以作業系統為主的系統上，但是在二元轉譯中，如何去處理動態連結的二元檔，尚未被廣泛討論。在二元轉譯系統中，有兩種方法可用來連結轉譯過後的可執行檔和其共享函式庫: (1) 我們可以使用轉譯過後的原始共享函式庫 (在原始平台的共享函式庫，稱作已轉譯共享函式庫) (2) 在我們的二元轉譯系統中，我們嘗試去連結目標平台的已經存在的共享函式庫 (稱作原生共享函式庫)。
Binary translation is commonly used to migrate applications from one ISA to another and dynamic linking of shared libraries is widely used in OS-based systems. But how to handle dynamically linked binaries in a binary translation system has not been widely discussed. There are two ways in a binary translation system to link a translated executable with shared libraries: (1) We may use the shared libraries that are translated from the original shared libraries, which are on the source platform (which are called the translated shared libraries). (2) In our binary translation system, we attempted to link with the target shared libraries, which are compiled for and already on the target platform (which are called the native shared libraries). Advantages of linking with native shared libraries include improving execution efficiency and saving system disk space. However, it is a significant challenge to handle the interactions between the translated executable and the native shared libraries since they may have different abstract binary interfaces (ABIs). We present a retargetable approach for linking translated executables with native shared libraries. We implement it on a static binary translation system, called LLBT, which translates ARM binary to LLVM IR in a target-independent way and then generates the translated binary by the LLVM infrastructure. The generated IR has been available to be retargeted to different architectures, such as MIPS, without modification. In our experiment, the translated programs in the SPEC2006 CINT benchmarks linked with native shared libraries ran faster than the ones linked with translated shared libraries on an i7 machine. Linking with native shared libraries can achieve an average speedup of 1.18.
|Appears in Collections:||Thesis|
Files in This Item: