標題: 一個在二元轉譯中連結原生函式庫且可重定目標之方法
A Retargetable Approach for Linking Native Shared Libraries in Binary Translation
作者: 郭政錡
Kuo, Cheng-Chi
楊武
Yang, Wu
資訊科學與工程研究所
關鍵字: 二元轉譯;可重定目標;動態連結;binary translation;retargetable;dynamic linking
公開日期: 2011
摘要: 二元轉譯是一種對移植應用程式到不同指令集常用的手段,動態連結共享函式庫也是經常被使用在以作業系統為主的系統上,但是在二元轉譯中,如何去處理動態連結的二元檔,尚未被廣泛討論。在二元轉譯系統中,有兩種方法可用來連結轉譯過後的可執行檔和其共享函式庫: (1) 我們可以使用轉譯過後的原始共享函式庫 (在原始平台的共享函式庫,稱作已轉譯共享函式庫) (2) 在我們的二元轉譯系統中,我們嘗試去連結目標平台的已經存在的共享函式庫 (稱作原生共享函式庫)。
連結原生共享函式庫的好處是可以增進執行效率和節省系統硬碟空間。然而,因為已轉譯可執行檔和原生共享函式庫有不同的ABI,如何去處理它們之間的互動是一個很艱鉅的挑戰。
我們提出一個在二元轉譯中連結原生函式庫且可重定目標之方法,並實作在一個靜態二元轉譯系統LLBT中,它可轉譯ARM二元碼到LLVM中介碼,然後利用LLVM的後端產生已轉譯二元碼,這是一個無關目標平台的方法。
在我們的實驗中,已轉譯的SPEC2006程式並連結原生共享函式庫在i7的機器上跑得比其換成原本連結已轉譯共享函式庫還快,連結原生共享函式庫可以達到平均1.18的加速比。
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.
URI: http://140.113.39.130/cdrfb3/record/nctu/#GT079955596
http://hdl.handle.net/11536/50504
顯示於類別:畢業論文


文件中的檔案:

  1. 559601.pdf

若為 zip 檔案,請下載檔案解壓縮後,用瀏覽器開啟資料夾中的 index.html 瀏覽全文。