Dynamic Function Call Handling in Binary Translation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Dynamic linking mechanisms, particularly those using Procedure Linkage Tables (PLTs), complicate program code conversion by modifying code at runtime, leading to inefficiencies in translator management of control flow and increased resource usage, especially in multi-threaded environments and systems like Solaris, where PLT updates result in excessive partitions and processing overhead.
Innovation Solution
A method and apparatus that identify and associate dynamically linked function calls with corresponding code without generating target code for the intermediate control structure, using a function linkage table to manage control flow and reduce processing and memory overheads, allowing direct association of function calls with their implementations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If dynamic linking with PLT is used to enable runtime function calls, then program flexibility and library reuse are improved, but translator management complexity and resource usage increase
Solution Approach 1:
The patent extracts the PLT intermediate control structure from the translation process. Instead of translating and managing the complex PLT runtime modification mechanism, the invention directly associates dynamically linked function calls with their implementing code, removing the problematic intermediate structure while preserving the dynamic linking functionality.
Solution Approach 2:
The patent introduces a function linkage table as a simplified intermediary structure. This table stores direct associations between function calls and their implementations, replacing the complex PLT mechanism. The function linkage table provides the necessary mediation between subject code and target code without requiring runtime code modification or complex translator management.
2Adaptability or versatility
If PLT updates are performed at runtime to link functions, then dynamic linking functionality is achieved, but processing overhead and memory usage increase
Solution Approach 1:
The patent performs preliminary association of function calls with their implementations during the translation phase rather than at runtime. The function linkage table is populated in advance, eliminating the need for runtime PLT updates and associated processing overhead. This preliminary action shifts work from the critical runtime path to the translation phase.
Solution Approach 2:
The patent creates a simplified copy of the linking information in the function linkage table, which stores direct associations between function calls and implementations. This copy eliminates the need for complex runtime modification operations while preserving the essential linking functionality, reducing both processing overhead and memory access complexity.
3Manufacturing precision
If intermediate control structures like PLT are translated, then accurate control flow translation is achieved, but target code size and translation complexity increase
Solution Approach 1:
The patent removes the intermediate control structure (PLT) from the target code generation process entirely. Instead of translating and including PLT entries in the target code, the invention directly generates code that associates function calls with their implementations through the function linkage table, eliminating unnecessary code complexity while maintaining control flow accuracy.
Data Source
AI summary
A technique is provided for handling dynamically linked subject function calls arranged pass subject control flow to an intermediate control structure such as a procedure linkage table, then to subject linker code for modifying link information associated with the subject function calls during translation of subject code into target code in a dynamic binary translator. The subject code for execution on a subject processor is received by a translator, and corresponding target code for execution on the target processor is generated. The translator is arranged to build a function linkage table containing an entry giving the location of each function called by the subject code, so that code can be generated by the translator in which subject function calls are associated with code for performing the function, without generating target code corresponding to the intermediate control structure.


